Re: Session and validation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Maybe that is my problem , that session variables will
get blown away when the validations are run in the
same page.  Shouldn't be right ?

A session variable will last the lifetime of the session... it's a php.ini setting. Session variables should remain in the session store until it is collected by the garbage collector.



Let me ask though if I setup just a validation page, then on success I'm still doing a redirect (cause it's a multi page form)

Not sure what the question was here?


Or if I validate on the next page and there is an
error, I redirect back, but then I also have to
consider how the error is going to get printed on the
first page.

You can store an error message in a session variable. On the first page do your error output like you normally would, just check this session variable to see if there's an error.


In addition to this, you can put some javascript on the first page to validate on the client's side. You shouldn't rely on this, but it can cut down on trips to the server with bad input.


Anyone ?

Stuart

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux