Click to See Complete Forum and Search --> : Redirect a visitor + bookmark + cookie


Lotz
06-17-2004, 01:11 PM
Hi,

I set up a cookie to force the visitors to pass through my index.php page. On each other pages (html) of my site, I check if the cookie exists, and if not I redirect the visitor to my index page. This index.php logs some information and set the cookie, then the visitor is redirected to my news.html page.

Now, I'd like to know how I can redirect the visitor (in my index.php) depending on where he came.

I mean if he come from the www.mysite.com, then he is redirected to my news.htm page, BUT if he came through a bookmark or entered an URL to a different page of my site, I'd like to redirect him to the address he enter at the beginning, before checking if the cookie exist.

How can I do that?

Here is my javascript code that redirects the visitors to the news.htm page after setting the cookie.

<SCRIPT language="javascript">
SetCookie("index","1",date_exp,myDomain);
window.location="news.htm";
</SCRIPT>

Thanks