Is it possible to display PHP errors/warnings only if admin account has logged in. I want to make a content div for admin users where error are displayed and can be turned on/off.
Even with disabling error_report, I can still see errors.
How can I turn it off?
<?php
error_reporting(0);
@ini_set('display_errors', 0);
echo "asf"2
?>
Page still shows the error
Parse error: syntax error, unexpected '2' (T_LNUMBER), expecting ',' or ';' in C:\xampp\htdocs\godhaze\index.php on line 5
By admin, I meant something like this
if(isset($_SESSION["usertype"])=="admin")
{
error_reporting(1);
@ini_set('display_errors', 1);
}
else
{
error_reporting(0);
@ini_set('display_errors', 0);
}
Also tried to read error_log.txt file, but getting error for file not found.