Hi I'm a novice programmer doing some very rudimentary php programming. My site has a MySQL database and I've built an admin page to add records using the following logic:
if ($submit)
then process data
else generate form
This has worked well for me. Now, I'm trying to password protect the page by using the same logic but adding an outer loop
if ($entered)
if password correct
if ($submit)
then process data
else generate form
else print 'password is wrong'
else generate password form
The outer loop or the password protection loop works fine, but once I get to the innermost loop, I get a problem. The first pass is fine, without $submit the code generates the data processing form; but once submit is pressed the program jumps not to the inner if statement but to the first line and runs the outermost loop again.
Any help would be very much appreciated, and please remember you're speaking with an idiot.
Thanks!