display_errors if variable
Moderator: General Moderators
display_errors if variable
So what I'm trying to see if it's possible is having my php.ini file have display_errors off but to display them if a certain user is logged in. But then I guess, for instance, if session_start() isn't put into the file correctly, it won't even be able to tell if the person is logged in. Any suggestions, and is this even a possibility (besides putting code to show errors if the person is logged in into every page)?
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: display_errors if variable
Try and use this...
Switch it on and off depending on the user.
Code: Select all
error_reporting(0);
- kaisellgren
- DevNet Resident
- Posts: 1675
- Joined: Sat Jan 07, 2006 5:52 am
- Location: Lahti, Finland.
Re: display_errors if variable
Or use set_error_handler() to use your own error handler function. Then accordingly in that function either display errors or not.
-
aschlosberg
- Forum Newbie
- Posts: 24
- Joined: Fri Jan 23, 2009 10:17 pm
Re: display_errors if variable
The display_errors directive can be set at runtime:
Code: Select all
ini_set('display_errors', 'On');