Please what is the best way to get the new value of a variable after the exit function in php. My script below is a sample, I want to get new value of variable $ee and use it to echo an error message after calling exit function.
$ee = 0;
$required = array('name', 'location', 'email', 'school', 'age');
if(isset($_POST['name'])){
foreach($required as $ff){
if(empty($_POST[$ff])){
header("location:register.php");
$ee = 1;
exit($ee);
}
}
}
The easiest way to keep that variable alive is through
PHP$_GET, example: