Link to home
Start Free TrialLog in
Avatar of jilim
jilim

asked on

Variable which can detect which webpage do you came from

Hie Experts....

In ASP, is there any server variables which can detect previously where do u came from?...example as below:

You are in first.asp and there is a link to second.asp. And in second.asp, it can detect that you are from first.asp.

If in third.asp also have a link to second.asp and you came to second.asp through third.asp, in second.asp 's server variable can detect you came from third.asp.

Is there any server varibales or any method that can detect previously you are visiting a page before came to the current page?

Thanx Experts.....hope that i can get the feedback ASAP!!

Cheers,
Jimmy
Avatar of Fenatu
Fenatu

<% Response.Write Request.ServerVariables("HTTP_REFERER") %>

This will show the page you got to this page from. If you clicked a link and got to the current page, there will be something there. If you typed in the URL, it will be blank.
Avatar of jilim

ASKER

Hie Fenatu,

I did try on HTTP_Referer, but it returns me blank. Any ideas on it??...beside this is there any otehr method??
Thanx
You have that line in the second.asp and clicked a link in first.asp to go to second.asp?

Avatar of jilim

ASKER

Hie Fenatu,

I did try on HTTP_Referer, but it returns me blank. Any ideas on it??...beside this is there any otehr method??
Thanx
Avatar of jilim

ASKER

Yeah....this line "<% Response.Write Request.ServerVariables("HTTP_REFERER") %>" i put it in second.asp.  so whenever first.asp or third.asp came...it still return blank to me.
Any idea???
Avatar of jilim

ASKER

Yeah....this line "<% Response.Write Request.ServerVariables("HTTP_REFERER") %>" i put it in second.asp.  so whenever first.asp or third.asp came...it still return blank to me.
Any idea???
But is it showing which page you came from in second.asp?
Avatar of Mark Franz
Look at the Javascript property referrer;

referrer Property

If a destination document is reached by a user clicking on a Link object in another document (the referrer), this property returns the referring document's URL.

Syntax: document.referrer

<script language="Javascript">
<!--

if (document.referrer&&document.referrer!="")
  document.write('Thanks for visiting this site from '+document.referrer+'<BR>');

//-->
</script>



Avatar of jilim

ASKER

Hie mgfranz...

Thanx it works!..... but unfortunately it's in JavaScript. Can transfer the value (document.referrer) to ASP format?? how??

thanx
ASKER CERTIFIED SOLUTION
Avatar of Mark Franz
Mark Franz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jilim

ASKER

thanx mgfranz...

but i'm still looking for a better solutions.