Hello everybody,
I have a site where I am selling some stuff. Now, when I click on the "Buy now" link, it leads to /buy.php page. But, when I just write in my address box in the Browser that URL of buy.php, it also opens it. How do I forbid opening it from other sides?
Thank you,
VBmaster
How to forbid opening a site?
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
One way to do this kind of verification is to the have pages on your site that have links to buy.php generate a unique key and both save it in session and add it to the URLs to buy.php. Then the buy.php page checks that the value in the session is the same as the parameter passed. This is a pretty common form validation methodology.
(#10850)
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
For more PHP security help and tips, be sure to explore the PHPDN's PHP Security forum. 