By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,336 Members | 2,315 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,336 IT Pros & Developers. It's quick & easy.

question about tracking

P: 54
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.
Dec 12 '07 #1
Share this Question
Share on Google+
1 Reply


code green
Expert 100+
P: 1,726
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.
Dec 12 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.