Author Topic: php code to hide errors.....  (Read 3755 times)

0 Members and 1 Guest are viewing this topic.

Offline anchorageweather

  • Forecaster
  • *****
  • Posts: 445
    • http://eetee.us/station/station.php
php code to hide errors.....
« on: February 25, 2008, 09:19:17 PM »
I seem to remember some code that can be added to a php file that will hide errors.  Can someone help me remember?  Thanks!!!!
South of the Tracks, Anchorage, KY

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6726
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: php code to hide errors.....
« Reply #1 on: February 25, 2008, 09:26:46 PM »
If you just want to hide Notice: type errors, the
Code: [Select]
<?php error_reporting(E_ALL E_NOTICE); ?> does the trick.

It's best to try and fix the Notice: errors though :-)

You can't 'hide' Error: or Warning: messages since they usually cause the script to malfunction.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline anchorageweather

  • Forecaster
  • *****
  • Posts: 445
    • http://eetee.us/station/station.php
Re: php code to hide errors.....
« Reply #2 on: February 26, 2008, 06:04:42 AM »
If you just want to hide Notice: type errors, the
Code: [Select]
<?php error_reporting(E_ALL E_NOTICE); ?> does the trick.

It's best to try and fix the Notice: errors though :-)

You can't 'hide' Error: or Warning: messages since they usually cause the script to malfunction.

Best regards,
Ken

Ken:

Thanks!  I was going to add the code for Caterlake's severe advisory program.  Sometimes (more often lately) the NWS in my area has trouble with their site.  The script can't call the info, and the result trashes my whole site.  I was hoping to have the rest of the page load without the severe weather info.  Unfortunately, I don't know enough php to do much else  :oops:

South of the Tracks, Anchorage, KY

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6726
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: php code to hide errors.....
« Reply #3 on: February 26, 2008, 09:58:46 AM »
You might try updating the Carterlake severe advisory program to the newer rss-top-warning.php (and the advisory script to rss-advisory.php) Both scripts incorporate 'soft failure' when there's a problem with the NOAA RSS feed (thanks to MCHALLIS and JMCMURRY for the script updates).

http://saratoga-weather.org/scripts-rss.php#topwarn
http://saratoga-weather.org/scripts-rss.php#NOAARSS

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP