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 whipped up this little script and I've looked over it many times, I can't figure out why its not working as intended.
Its a script to be used for logging in and editing a text file which is to be included by another page. But, after logging in its taking me back to the login form part even though it should have authenticated me and let me edit the file.
It appears to be the order of the if conditions. Try the following. I also added "</textarea>" in the text form as it can cause issues without it. Hope this helps.
You are a little exit() happy and could use some work in the structured programming dept. After a redirect is one of the few places where exit() is used.
I would recommend not having the login/logout and the editing on the same page. You semi-agree with that because you redirect to edit.php even though you have editing code here. Keep the login/logout code on this page and code edit.php separately.