1 Attachment(s)
[php] simple login - need a pro to optimize
Well, every line of the script I am posting here is written by me. Finally, I had done something bigger than simple form submitting.
So here's a login script, which has user array which is checked every time the page is executed. The username/pwd is compared with a cookie and if cookie with data meets, the page is being displayed. If the usr/pwd is not correct you will see the login screen.
Now, the cookie expires in 20 seconds (I just needed this not to wait long till it expires but later it will be longer). And the username/pwd are raw atm. - I will change this by myself.
So what I am asking is to drop an eye on source and give suggestions to me, what should be corrected, wrong, etc., since I am really a beginner. Don't know if you like my method of page refreshing with HEADER, but this seems to be very useful to this kind of scripts, because you may not hit back button and refresh button wouln't give double submit form. BUT, it seems that firefox wouln't operate such script at all.
The db wouln't be big, so I am not planning to add mysql/sqlite for now. I am not ready for trying this since queries look so hard to understand for me..
Any suggestions, comments and corrections are welcome.
TY