jaynesh — 2012-05-18T10:46:55-04:00 — #1
I have two pages.
Index.php (Contains a login form)
Login.php (Processes the login data)
In the Login.php page, any errors are stored in an array and displayed on that same page.
I want to redirect the user to Index.php and display the error data on that page.
What is the best way to do this?
starlion — 2012-05-18T12:16:59-04:00 — #2
do your form processing on index.php instead?
serverstorm — 2012-05-18T12:47:22-04:00 — #3
So you have database, because you could use PHP searialize function and write it to a table in your database, then write a session variable that 'errors:1' and then test on the session, retrieve and unserialize the data and display.
Alternatively you can post the errors to the index.php page and check if the errors post values have been set, if so display them.
You could also write the errors to the users session although this is not intended for a large amount of data.