Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Error

Status
Not open for further replies.

jammer1221

Programmer
Jul 30, 2003
352
US
Hi, I know in Javascript you can 'suppress' any errors that happen. But is it possible to do it in PHP. Like in Javascript its something like
Code:
<script> window.error = null </script>
but, What's happening is i'm getting this in the actual page
Code:
Warning: unexpected error in date() in c:\phpdev\[URL unfurl="true"]www\pollvote\inc\pollfunctions.php[/URL] on line 130

Warning: unexpected error in date() in c:\phpdev\[URL unfurl="true"]www\pollvote\inc\pollfunctions.php[/URL] on line 132
is there any way for me to keep it from writeing that in my page. I know this may sound a little confusing...becuase i only know a little of what im talkin about but if you would like me to rephrase is just post back here. Thanks
Jammer1221
 
you can do it...
it must be configured in the &quot;php.ini&quot; file... just read the documentation of the php.ini.

look at vars error_reporting, display_errors (default on, let it off and you will not get the errors on the page), log_errors (default off, let it on if you set display_errors = off).

I suggest to let the errors be displayed in the development server, in order to fix all problems & hide the errors on production server.

hope this helps you.
 
Thank you very much...and thanks for the advice.
Jammer1221
 
If you want to force some function not to display error, just put @ before the function. In your case, it will be something like this:
Code:
$var=@date();

But this is not a real solution. You should eliminate the errors correcting your code instead of hiding the errors ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top