mike1313 Posted March 29, 2007 Share Posted March 29, 2007 Is it possible to stop a user from viewing a certain page if they entered the page by typing the url in the address bar? Link to comment https://forums.phpfreaks.com/topic/44826-stopping-users-from-entering-thru-a-url/ Share on other sites More sharing options...
per1os Posted March 29, 2007 Share Posted March 29, 2007 You can check the referrer but that is very un-reliable as it is easily spoofed. You could use sessions to see if they were previously on another page. Link to comment https://forums.phpfreaks.com/topic/44826-stopping-users-from-entering-thru-a-url/#findComment-217661 Share on other sites More sharing options...
Daleeburg Posted March 29, 2007 Share Posted March 29, 2007 make it so that the home page starts a session with a varible assigned as 1 then on each page that you dont want them to go straight to just do a if(isset($_SESSION('beenhere')) AND $_SESSION('beenhere') == 1 ){ Whatever }ELSE{ echo 'YOU CANT GO HERE FOO'; }; ~d Link to comment https://forums.phpfreaks.com/topic/44826-stopping-users-from-entering-thru-a-url/#findComment-217664 Share on other sites More sharing options...
per1os Posted March 29, 2007 Share Posted March 29, 2007 replace the $_SESSION() with $_SESSION[] =) Link to comment https://forums.phpfreaks.com/topic/44826-stopping-users-from-entering-thru-a-url/#findComment-217683 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.