Question about form classes

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all,

I have a quick question about form classes. I am following this

Basically, it is a login system. There is a session.php and a
process.php that is called when validating a login. The problem I am
having, is on my login form I fill out the fields and then the <form>
calls process.php. In process.php, the $form->num_errors is being set
correctly. Then, it redirects back to my login form.

Well, for some reason I am losing $form->num_errors when returning to
the login form. I am new at this, so I am not sure what is causing

Quick rundown of what I think is happening...

login.php has 'include ('session.php')' at the top...
The $form is created at the bottom of session.php...
login.php submits to process.php...
process.php also has 'include ('session.php')' at the top...
if login is incorrect, process.php calls 'header("Location: ".
login.php is loaded and $form is empty

Can anyone give me an idea of where to start looking?


Re: Question about form classes

Quoted text here. Click to load it

Looks like your losing state between your redirect.  Make sure that
the the value for $form->num_errors are either being passed with a
request method (POST/GET/SESSION) and 'rebuilt' within
session.php...or that $form is being serialized and passed, then

Re: Question about form classes

Thanks for the reply. Sadly, 30 minutes later, I figured out the
problem. It's called Zone! For whatever reason, it was
blocking my info on the development machine. As soon as I turned it
off, everything worked as it should. Just thought I'd post that in
case someone else runs into a similar problem.

Re: Question about form classes

Quoted text here. Click to load it

awesome, thanks

Site Timeline