Re: Question about form classes



On Aug 31, 1:15 pm, stacey <monkeym...@xxxxxxxxx> wrote:
Hi all,

I have a quick question about form classes. I am following this
tutorial:http://www.evolt.org/article/PHP_Login_System_with_Admin_Features/17/...

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
it.

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: ".
$_SERVER['HTTP_REFERER']);'
login.php is loaded and $form is empty

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

Thanks

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
unserialized.


.



Relevant Pages

  • Re: Forms Authentication - Confused!
    ... Again, the authentication occurs correctly, but the secured resource does ... not think the user is authenticated, following the login. ... > If you would like to zip your solution and email it to me (take out secure ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: RedirectFromLoginPage
    ... Much appreciated Greg. ... > redirects you to page of choice after logging in. ... > If you do login succesfully, then attempt to go to page your are not ... > Private Sub Page_Load(ByVal sender As System.Object, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: RedirectFromLoginPage
    ... redirects you to page of choice after logging in. ... If you do login succesfully, then attempt to go to page your are not ... Private Sub LoginClick() ... requested (returnURL = nothing when clicked on logout) ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Forms Authentication - Confused!
    ... If I visit my login page directly, and enter a correct username/password, it ... If I visit the secured page (which automatically redirects me to the login ... The URL of my secured folder is http://localhost/contenteditor (I wish to ... secure all pages within this dir) ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: logout issue
    ... that redirects me back to the login page ... >> and then I paste it in to the address bar, the browser redirects me to the ... >> Password are not transmitted through the query string, authentication is ...
    (microsoft.public.dotnet.framework.aspnet)