Checking what page the user came from..?
Moderator: General Moderators
Checking what page the user came from..?
Hello, I'm interested in using PHP to check what the users previous page was, I've used yahoo and have tried searching but I'm not sure what keywords I need to use and I couldn't come up with anything. Basically i want to make sure they come from a specific page, and if they dont, it forwards them there. Lets say they goto PAGE 2, but I don't want them to goto PAGE 2 without going to PAGE 1 first. if they go directly to PAGE 2 it automatically forwards them to 1. I was thinking, maybe page 1 could hold a cookie, and page 2 checks for it, and if it finds it, it accepts them, and removes it? I wouldn't know how i would go about setting that up though.
- daven
- Forum Contributor
- Posts: 332
- Joined: Tue Dec 17, 2002 1:29 pm
- Location: Gaithersburg, MD
- Contact:
Check out $_SERVER['HTTP_REFERER']
http://www.php.net/manual/en/reserved.v ... les.server
It contains the address of the previous page the user accessed.
http://www.php.net/manual/en/reserved.v ... les.server
It contains the address of the previous page the user accessed.