For everyone who thought about the error_reporting () function, this is not so, I need it when the MySQL query has been executed, and the instruction has the form
if($result)
{
echo "Yes, it was fine... bla bla";
}
else
{
echo "Obviously, the echo'ing will show in a white page with the text ONLY...";
}
Whenever statements were true or false, I want the error to appear when redirecting using the header () function and echo the error messages in the div somewhere on the page.
Basically something like this:
$error = '';
This part appears inside div tags.
<div><?php echo $error; ?></div>
That way, part of the error will be echoed when redirected with a () header
if($result)
{
$error = "Yes, it was fine... bla bla";
header("Location: url");
}
else
{
$error = "Something wrong happened...";
header("Location: url");
}
But this just doesn't work :(
source
share