Connecting Tech Pros Worldwide Forums | Help | Site Map

question about tracking

Member
 
Join Date: Sep 2007
Posts: 53
#1: Dec 12 '07
my question is about tracking the previous page.

there is a form(ex=subscribe.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's Avatar
Expert
 
Join Date: Mar 2007
Location: England
Posts: 1,079
#2: Dec 12 '07

re: question about tracking


The following returns the previous URL
[PHP]$url = $_SERVER['HTTP_REFERER'];[/PHP]
Quote:
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.
Reply