IlaminiAyebatonyeDagogo Posted October 4, 2013 Share Posted October 4, 2013 Good Day my friends. Please I need Help. I have a website that required registration, before user can be able to view the pages. Now the problem with my work is that if a user manage to forge the link in my webpage example google.com/user.html, it will be accessed where that page should only be seen by login user not vistor that forge the link or users that haven't logged in. So what i want is how to protect a webpage from being seen by guest, rather when they try to access the user page it should redirect them to the login page. That means everyone must login to see any page except the login. I was hoping i could get a php code or javascript or css or html code that will help do that. Someone please help me. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/282725-preventing-unregistered-users-from-viewing-some-pages/ Share on other sites More sharing options...
AbraCadaver Posted October 4, 2013 Share Posted October 4, 2013 After successful login set a session var, maybe their username or just loggedin = true or something. Then on each "protected" page check for that session var. Give it a try and post some code. Do you have the login coded already? Link to comment https://forums.phpfreaks.com/topic/282725-preventing-unregistered-users-from-viewing-some-pages/#findComment-1452632 Share on other sites More sharing options...
IlaminiAyebatonyeDagogo Posted October 4, 2013 Author Share Posted October 4, 2013 (edited) yes sir, i av a very simple login scrpt and cn u b kind enough 2 write d code of wot u said. Edited October 4, 2013 by IlaminiAyebatonyeDagogo Link to comment https://forums.phpfreaks.com/topic/282725-preventing-unregistered-users-from-viewing-some-pages/#findComment-1452647 Share on other sites More sharing options...
.josh Posted October 5, 2013 Share Posted October 5, 2013 I cn b kind enuf 2 rite d code of wot he said if u cn b kind enuf 2 put monies in my paypal pl0x kk thx. Link to comment https://forums.phpfreaks.com/topic/282725-preventing-unregistered-users-from-viewing-some-pages/#findComment-1452654 Share on other sites More sharing options...
IlaminiAyebatonyeDagogo Posted October 5, 2013 Author Share Posted October 5, 2013 oohh dis kin admin na wa ohh Link to comment https://forums.phpfreaks.com/topic/282725-preventing-unregistered-users-from-viewing-some-pages/#findComment-1452655 Share on other sites More sharing options...
.josh Posted October 5, 2013 Share Posted October 5, 2013 ooh eeh ooh ah ah? Link to comment https://forums.phpfreaks.com/topic/282725-preventing-unregistered-users-from-viewing-some-pages/#findComment-1452656 Share on other sites More sharing options...
Recommended Posts