<img> tag ASP script execution

M

Mike Kanski

I have an asp page that contains a simple insert statement and redirect
i.e.:

Page1.asp
<%oconn.execute "insert into table 1 values(1)"
response.redirect "newpage.asp"
%>

I have to add some code to it to not allow execution of this script if the
page was called from the <img> tag i.e..

<img src=http://webname.com/page1.asp width=1 height=1>

The page should be opened in browser in order for the script it contains to
be executed. How do i acomplish that?
 
R

Ray at

I think I can understand why you want to do this, but it seems that the only
way you can do this is:

1. Force the user to confirm the page or require some other user
interaction.
2. Don't have a page that inserts data just by loading.

Ray at work
 
D

Dave Anderson

Mike Kanski said:
I have to add some code to it to not allow execution of this script if the
page was called from the <img> tag i.e..

<img src=http://webname.com/page1.asp width=1 height=1>

The page should be opened in browser in order for the script it contains to
be executed. How do i acomplish that?

As far as IIS is concerned, a request is a request -- how the browser
chooses to dispose of the Response is immaterial. You can test this by
collecting the contents of the Request.ServerVariables collection and
storing them in a DB, then comparing the differences.

If the <IMG> only resides on a single script, then you might have a shot at
dealing with it by examining HTTP_REFERER.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,140
Latest member
SweetcalmCBDreview
Top