PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
i was wondering if someone could help me with my login script that i made i was wondering if someone could show me how to make it where the admin can login on the same login place as players but go to admin page.. and help me make the script so people can recover there passwords using there email address they signed up with the username... here is the login scrip
Mate I would use a login script and have an extra field in your users table in your database called admin for example and then use 1 = Admin 0 = Not admin, Then intergrate that into the login script. So add the if tag and then use the variable to redirect them either to the admin area or normal login section.
1. sanitize your input data
2. run your query
3. check if any rows were returned
a) if rows were returned
i) Check their access level
ii) assign them their access level via sessions
1) redirect them to admin page if they are admin
OR
redirect them to user page if they are normal user
b) if no rows returned login invalid
There is no need for a dropdown menu.. just have a flag in your users row that lets us know if hes an admin or normal user and run the appropriate actions depending on his access level. I would also be running checks on their access level on restricted pages.
that is like talking in a different language on that part Jcart.. i build this login from looking at alot of different kinds of code so i know not much of php im still in the process of learning i build this login script about 4 or 5 months ago and when i get admin login on with it its im going to be making it as a login script for a Chat room...