<img> tag ASP script execution

Discussion in 'ASP General' started by Mike Kanski, Sep 15, 2003.

  1. Mike Kanski

    Mike Kanski Guest

    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?
     
    Mike Kanski, Sep 15, 2003
    #1
    1. Advertising

  2. Mike Kanski

    Ray at Guest

    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" <> wrote in message
    news:%23%...
    > 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?
    >
    >
     
    Ray at, Sep 15, 2003
    #2
    1. Advertising

  3. "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.
     
    Dave Anderson, Sep 15, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. news.austin.rr.com

    how to download img from html img tag

    news.austin.rr.com, Apr 27, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    517
    Steve C. Orr [MVP, MCSD]
    Apr 27, 2005
  2. shruds
    Replies:
    1
    Views:
    856
    John C. Bollinger
    Jan 27, 2006
  3. Philipp Lenssen

    Problem: <img></img>

    Philipp Lenssen, Jun 27, 2005, in forum: XML
    Replies:
    15
    Views:
    774
    David Håsäther
    Jul 3, 2005
  4. Jopek
    Replies:
    7
    Views:
    408
    dorayme
    Apr 26, 2009
  5. Replies:
    7
    Views:
    185
    Tad McClellan
    Jun 22, 2006
Loading...

Share This Page