Project / Support Center
Welcome, Guest. Please login or register. August 13, 2022, 01:28: PM
Home Help Search Login Register
D-Web Web Site Creator D - Web Web Site Creator On-line HTML Editor No Programming knowledge required. Web Global Net PayPal-Cart Shopping Cart System PayPal - Kart Shopping Cart System for E-Commerce over the internet, that's easy to use. Web Global Net Newsletter Manager Newsletter Manager On-line Newsletter Creator with Email Subscriber Management.
Ring Central Discount
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  php related  |  Topic: Stopping PHP error messages from appearing on your web page 0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Send this topic Print
Author Topic: Stopping PHP error messages from appearing on your web page  (Read 4517 times)
admin
Administrator
******
Offline Offline

Posts: 234


« on: August 02, 2017, 10:55: PM »

place this code at the beginning of your code:

 <?php
ob_start();
error_reporting( E_ALL ^ (E_NOTICE | E_WARNING | E_DEPRECATED | E_STRICT));
?>

or this

<?php
error_reporting(0);
echo "Sorry there was an ERROR please check
 your entries for the error message";
?>

You can change the echo message to what ever you what.

Sometimes you need the error message to appear while debugging a page in that case use this code:

<?php
error_reporting(E_ALL);
echo "Here is some text";
?>

you can also use this to not display any error - might be helpful for Division by zero errors

<?php
error_reporting(0);
echo "";
?>
« Last Edit: July 09, 2021, 06:48: PM by admin » Report to moderator   Logged

The Unknown Webmaster
Pages: [1] Go Up Send this topic Print 
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  php related  |  Topic: Stopping PHP error messages from appearing on your web page « previous next »
Jump to:  


Login with username, password and session length
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!