ZoundZ Posted December 23, 2007 Share Posted December 23, 2007 This is my first post, so hello. I was hoping someone had an idea on how to do this, because even though I'm a decent with PHP, I have no idea how it's done. I want to make it so people can enter in my website URL(like this : www.mysite.com/) , but, I want to make it so that if they enter in something after the slash(like this: mysite.com/blah.php) they get an error. Anyone know how this can be done? I want them to access blah.php, but only by a link on my website, not by entering it in themselves. Thanks in advance for any help I receive. Quote Link to comment https://forums.phpfreaks.com/topic/82978-how-to-stop-url-editing/ Share on other sites More sharing options...
papaface Posted December 23, 2007 Share Posted December 23, 2007 $page = "http://www.domain.com"; if ($_SERVER['HTTP_REFERER'] != $page) { exit; } else { //page } Quote Link to comment https://forums.phpfreaks.com/topic/82978-how-to-stop-url-editing/#findComment-422025 Share on other sites More sharing options...
ZoundZ Posted December 24, 2007 Author Share Posted December 24, 2007 Well, that stops people from going to any page other than the index page. I want them to be able to go to it, I just don't want them to be able to go to it by editing the URL. So, if they're clicking links, they can go to it. Quote Link to comment https://forums.phpfreaks.com/topic/82978-how-to-stop-url-editing/#findComment-422066 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.