PDA

View Full Version : Detecting Source


zijian60
12-29-2008, 06:35 PM
Hi,

If I have page A and page B. I only want user to be able to enter page B by a link from page A. I want to make sure user cannot enter page B through other methods like copying the url etc.

How do i go about doing it using php?

yell0wdart
12-29-2008, 08:30 PM
You can get that by accessing $HTTP_REFERER in your PHP code. It's not perfect, you shouldn't depend on that only (if you're displaying sensitive data), as HTTP header info can be injected via XSS or HTTP debugging utilities like Fiddler.