954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Password protection for Website

I have a password protection for my website. The LogIn name and passwords are stored in a mysql database.
My question is: How can I define that a person who has a LogIn can only see some pages of the whole website? How can I connect the information about which pages the user is allowed to see with its LogIn information? In mysql as well as in my php programmed website?

wernervogg
Newbie Poster
1 post since Nov 2006
Reputation Points: 10
Solved Threads: 0
 

Just check to see if they are logged in on the pages they can only see when logged in. A simple cookie check can do this.

stymiee
He's No Good To Me Dead
Moderator
3,360 posts since May 2006
Reputation Points: 161
Solved Threads: 38
 

i think what you're talking about are called 'permissions'. you want certain users to have perission to only certain pages. i'm not sure how to do this, as i've never done it myself. but i would start with handling 'sessions'. check 'em out. www.php.net/session

boo_lolly
Light Poster
35 posts since Nov 2006
Reputation Points: 10
Solved Threads: 1
 

You could maybe add new columns to the database. eg.

username, password, section 1, section 2, section 3.

Where section 1, 2, 3 would define different levels of access. If the user were allowed access to section 2 the value stored in the database could be 1. If they weren't allowed then you could put a value of 0.

Hope this helps.

phper
Posting Whiz in Training
213 posts since Nov 2006
Reputation Points: 22
Solved Threads: 19
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You