473,405 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

<img> tag ASP script execution

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?
Jul 19 '05 #1
2 4498
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

"Mike Kanski" <mk*****@asi-solutions.com> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
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?

Jul 19 '05 #2
"Mike Kanski" wrote:

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.
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Philipp Lenssen | last post by:
My friend has the following problem (background: we want to transform XML to XHTML via XSLT): "We copy XHTML fragments into an output by using the following template: <xsl:template match="*"...
5
by: MyndPhlyp | last post by:
I've been busting my head trying to figure this out for quite some time. With IE6 and NS7, no problems. I can simply code the HTML <img height="100%"> and be done with it. But NS4 and NS6 (and...
8
by: KS | last post by:
Just to show some code to show the consept. <img id="date" onclick="javascript:show_calendar();" src="/PlexSysWeb/images/show-calendar.gif" width=20 height=18 border=0> What i want the...
15
by: Gérard Talbot | last post by:
Hello all, I'd like to know and understand the difference between, say, <img src="/ImageFilename.png" width="123" height="456" alt=""> and <img src="/ImageFilename.png" style="width:...
3
by: Henry Johnson | last post by:
Okay - I'm spinning my wheels on this one... can someone help me figure out how to programmatically populate a table cell as follows (from C# code-behind)? I've tried using a Literal control in the...
4
by: manu3d | last post by:
Hi everybody, I'm using the event "onload" to trigger a function when an image has been preloaded. But it seems to me that the function is triggered right at the beginning of the transfer from...
1
by: Carl | last post by:
Hi all I have a javascript function that drags and drops an element (ie img) into a container (ie bordered div). The function works and returns the element and and container. My next step is to...
4
by: SammyBar | last post by:
Hi all, I wonder is it possible to upload the content of an <imgfield to a server. The content of the <imgwas downloaded from a web site different from the one it should be uploaded. The image...
0
by: rrs5 | last post by:
Hello, I am a mod_python newbie. I hope this is a right forum to post this question. I have a python publisher script that generates a dynamic html file with a couple of images. How do I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.