worldworld Posted February 26, 2007 Share Posted February 26, 2007 Hi, I am a PHP Developer and have isssue of how can I protect pages using MySQL and PHP. Thanks for help.... Quote Link to comment https://forums.phpfreaks.com/topic/40140-protect-pages-using-mysql-and-php/ Share on other sites More sharing options...
skali Posted February 26, 2007 Share Posted February 26, 2007 If you are trying to restrict page views on the basis of user rights and authentication on the basis of userid and password then. You will need to. 1- create a users table in db and store userid's and passwords in it 2- authenticate users by presenting a form when they try to access protected pages. 3- Once you have authenticated users then store their info in $_SESSIONS array. 4- now check the $_SESSION variables on every protected page. 5- if the information is there then allow to view the page. 6- if the information is not there then send users to login page. Hope this helps. Quote Link to comment https://forums.phpfreaks.com/topic/40140-protect-pages-using-mysql-and-php/#findComment-194217 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.