Page 1 of 1
making an administrator's account
Posted: Thu May 13, 2004 11:02 pm
by James M.
Hi, I am trying to make an administrator's acount for a site i'm making that allows me to delete user accounts(delete mysql entries), add news content ( amend .inc file), etc.
Since im pretty new to php, i just want to know how would i get started in making a administrators account? Thanks for any help ahead of time.
Posted: Fri May 14, 2004 3:41 am
by fnleong
hav u create a admin table?u should create this first
Posted: Fri May 14, 2004 1:47 pm
by James M.
well i don't know what the rows should be or what i'd even do with them?
Posted: Fri May 14, 2004 2:57 pm
by pickle
This is a pretty broad and vague question, but I'll do my best:
- When you make user accounts in your database, put in an extra field that delineates if a user is an admin or not.
- For the administrative functionality, you will have to add pages that allow users to do that, for example deleting entries. In those pages, have a security check that makes sure the user logged in is an admin. If not, display an error, boot them out or something, just don't let them use the page.
Does this make sense?
Posted: Fri May 14, 2004 3:05 pm
by James M.
makes sense, i think i have a way of making an administrators account for my site, i'm not use to thinking in php much. If i need anymore help, i know where to go, thanks.
Posted: Fri May 14, 2004 5:09 pm
by tim
to add-on to pickles post
what I did, was combined sessions and cookies to a MySQL database
I made an extra field (I called it admin) and set it to default 0 (not a admin) and when I change the field value to 1 (a admin) then all you need to do is run sql queries against the table to compare n contrast the session_usernames or usernames to the value in the db
hope that may shed some light or be a better approach for you