How to tell where someone was redirected from using php, html, and mysql.?

Marc

New member
I have a website currently under construction but going very well. This is how my site works. I have a duplicate of each page that will serve as the public page and the members only page. When a user jumps to one of the member pages without using a form or anything else, the php code first checks to see if that ip is logged, i.e. registration and if they wished to stay logged in. If all is false it will redirect them to the public duplicate page.

Now, I have a single log in page that does all the mysql work and if all conditions are true it will redirect to the members page using a hidden value that tells the browser to send the person back to their original page. But, my own code is catching that and if the user doesn't check the box to stay logged in, then it will nullify their account and log them back out.

How do I tell what page in my site they were redirected from so that I can override that?

I'm using: echo "<script>window.location = 'location'</script>";


Thanks,
 
Back
Top