Hi, Say I have 4 html files: 1.html 2.html 3.html I want to allow users to reach 2.html only if they click a link on the page 1.html If they directly write the URL into the address bar, or click a link from some other site / page, they should not be allowed to reach 2.html Likewise 3.html should only be accessible by clicking a link from 2.html and in no other way. How would I do this? Thanks Ajeet
here is what you are looking for http://www.hotscripts.com/forums/php/attachment.php?attachmentid=87&d=1068969206 however, you must keep in mind that this method isn't secure and can be easily tricked
Hi Ajeet, I'd recommend making a 'state machine' for this particular problem. Basically what happens is when the user goes to the first page you create a new entry in a 'beenthere-donethat-bought-the-t-shirt' table. So for the first page the user's info is stored as 'state=page1'. When he reaches the 2nd page he is updated to 'stage=page2' an so forth. I wouldn't use any sort of cookie authentication for this at all as that can usually be faked w/out signing the session to a private key of some sort -- chances are that the cookies you have on this guy don't do that right now, but who knows times are changing. Instead of thinking -- oh great I have to create a new user for each request just think -- I'm creating a new session for each user and it is stateful. It's really quite easy to implement. Let me know if you need more help or want me to expand on this.