Click here to Skip to main content
15,920,438 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have some idea but which one is the best and why, and is there any other way to do this?

- Sessions
- GET Params, but if there is a lot of errors(for example a register form) it could be ugly.
- POST Params, but it needs a form with a JS redirection.


What I have tried:

- Sessions
- GET Params, but if there is a lot of errors(for example a register form) it could be ugly.
- POST Params, but it needs a form with a JS redirection.
Posted
Updated 30-Mar-21 6:29am

1 solution

Details are here - but, if going from page-to-page directly (not stopping on the client) then you may wish to rethrow the error if it's appropriate (i.e., from the current function back to the caller).

See example 7 for an example of rethrowing an error.[^]

If you'll be stopping at the client then $_SESSION is a good place as it will last as long as you wish but take care to drop the value as soon as possible as it will persist until they close the browser.


 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900