sepoto Posted July 9, 2011 Share Posted July 9, 2011 I am trying to supress the display of this: Notice: Undefined variable: closedhh in C:\inetpub\wwwroot\dsgog\edit_profile.php on line 124 Call Stack # Time Memory Function Location 1 0.0231 382192 {main}( ) ..\edit_profile.php:0 Without really turning off my error reporting. Is this possible to do by using code in my php file? I would rather do that than modify my php.ini.Thank you! Link to comment Share on other sites More sharing options...
birbal Posted July 9, 2011 Share Posted July 9, 2011 You can use '@' oprator to supress error.http://www.php.net/manual/en/language.oper...s.execution.phpthere is also option for setting ini_set() in your script to change the setting dynamicaly in the script. You can log the errors also. without changing the php.ini Link to comment Share on other sites More sharing options...
thescientist Posted July 9, 2011 Share Posted July 9, 2011 I wouldn't really advocate the use of error surpression. As a developer, you should want to know when there are errors and try and handle them. Why not test the value of the variable and handle it that way, possible by re-assigning it a value. Or better yet, just initialize it.... Link to comment Share on other sites More sharing options...
sepoto Posted July 9, 2011 Author Share Posted July 9, 2011 I wouldn't really advocate the use of error surpression. As a developer, you should want to know when there are errors and try and handle them. Why not test the value of the variable and handle it that way, possible by re-assigning it a value. Or better yet, just initialize it....If only the original programmer of this 2000 lines of code where that wise. Link to comment Share on other sites More sharing options...
thescientist Posted July 10, 2011 Share Posted July 10, 2011 yeah, but that doesn't mean you can't still initialize it though. Link to comment Share on other sites More sharing options...
justsomeguy Posted July 10, 2011 Share Posted July 10, 2011 You can turn off notice reporting like this:error_reporting(E_ALL ^ E_NOTICE); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.