|
Well for the member VS surfer access.
Your member must be logged on for this to work.
SO
if ($_SESSION['member']){
// we have a logged on users.
$sql = select * from whatever";
} else{
$sql = "select field1, field2, etc from whatever";
}
That will sort out who gets what content. (providing on a login you assign you user details to the session.
When I talk of permisions I am talkinga bout DB related permisions. Not DB access permision.
I.E
create table user (
id in not null auto incremant,
name varchar(50),
email varchar(50),
password varchar(32),
privs int,
primary_key(id)
);
The privs field here is what I am refering to. Once your member logs in you pass your result into the session.
SO
$row = mysql_fetch_row($result);
$_SESSION['member'] = $row;
Now they are in the session and you can access privs anywhere.
SO
if ($_SESSION['member']['privs'] >= 100) will return true for logged in members and you can then dish out member content.
Dont ever set any file permissions to 777 or you will find yourself exploited and will have to spend a day or so sorting out all the extra content on your website.
Ibbo
Last edited by ibbo; 06-28-2006 at 05:04 AM..
|