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!
Dont think this script will get you very far in your admin script... The condition is something you set it to be and then check for it. normally a admin login script works like this
1. Check if admin is logged in. (this can be done with sessions, cookies or a text file. Normally sessions are used)
2. If admin is logged in some checks are ran in order to make sure it is really an admin
3. If all the checks turns out ok you see the admin page
4. If checks fail or the admin has not logged in (as in not written his username and password) then it show the login form.
If you dont mind me asking.... what code is it you have for your admin login ? and are you aware that the code you have is not at all enough in order to get your client to be able to edit pages online.
From the script you showed it looks like that you need to enter username and password and then the script looks up the same file.... now if this is the case of course you want to do some authentication checks before your client can update a page... where do you store admin username and password ?
this is not the full code.
the client is not going to be editing any thing.
the admin login code is to big:
1- login page
2- check if username and password is right page
3- login success page
4- login fail page
5- logout page
only one question are the session secure or is it better to use a boolean variable
or is there any flows in my way of coding, that i must consider using 2 pages for every page one for the client and one for the admin
I used to just run sessions but then i friend told me to start run some checks on stuff. I can send you some code over from a friend... if you have msn PM me and i will contact you and send it over...