Jump to content

Protect pages using MySQL and PHP


worldworld

Recommended Posts

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.