question about tracking

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • runway27
    Banned
    New Member
    • Sep 2007
    • 54

    question about tracking

    my question is about tracking the previous page.

    there is a form(ex=subscri be.asp) which is an asp page where users can sign up for newsletters. this asp file calls a php file in the form action which i have written and this php file processes information user entered and inserts to the database. this works fine. in the website there are numerous pages from which a user can click on an image and be redirected to subscribe.asp and fill in the form.

    I need to know which page the user was before subscribe.asp ex = aboutus.asp, contactus.asp etc.

    please provide the code by which i will be able to track the source of the previous page.

    NOTE = The form page can only be an asp file as i am using a cms which does not support php files due to this the form page will only be an asp file

    thanks.
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    The following returns the previous URL
    [PHP]$url = $_SERVER['HTTP_REFERER'];[/PHP]
    PHP manual: The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.

    Comment

    Working...