I found a good way to make it transparent. I have a lot of errors to collect on a rather large form for a client of mine and want to display them nicely, without cluttering the URL with $_GET.
session_start(); at the beginning of the file for the form. when processing the submitted form: for each error, set $_SESSION['error']['error_name'] = "error text"; then redirect() to self. unset($_SESSION['error']) at the end of the file.
if(isset($_SESSION['error'])){
foreach($_SESSION['error'] as $name => $error){
//Display error
}
}
0 replies