lucerias Posted November 9, 2006 Share Posted November 9, 2006 How to do the configuration to hide the PHP warning message? Thank you. Link to comment https://forums.phpfreaks.com/topic/26673-hide-php-warning-message/ Share on other sites More sharing options...
Jenk Posted November 9, 2006 Share Posted November 9, 2006 by fixing the problem. Link to comment https://forums.phpfreaks.com/topic/26673-hide-php-warning-message/#findComment-122021 Share on other sites More sharing options...
lucerias Posted November 9, 2006 Author Share Posted November 9, 2006 I mean is there some way else we can hide the warning message? Thank you. Link to comment https://forums.phpfreaks.com/topic/26673-hide-php-warning-message/#findComment-122025 Share on other sites More sharing options...
lucerias Posted November 9, 2006 Author Share Posted November 9, 2006 The warning message is like this:Warning: Division by zero in C:\Apache Group\Apache2\htdocs\customer.php on line 201 Link to comment https://forums.phpfreaks.com/topic/26673-hide-php-warning-message/#findComment-122026 Share on other sites More sharing options...
Jenk Posted November 9, 2006 Share Posted November 9, 2006 Not dividing by Zero would fix that.[code]<?phpif ($number !== 0){ $result = 5 / $number;}?>[/code]Do not hide problems, fix them. It is utterly poor programming practice to just ignore problems. Link to comment https://forums.phpfreaks.com/topic/26673-hide-php-warning-message/#findComment-122027 Share on other sites More sharing options...
lucerias Posted November 9, 2006 Author Share Posted November 9, 2006 Jenk, i appreciate your advice and i will fix it. On the other side, i want to know how to hide them, this is for my knowledge purpose. Link to comment https://forums.phpfreaks.com/topic/26673-hide-php-warning-message/#findComment-122028 Share on other sites More sharing options...
Orio Posted November 9, 2006 Share Posted November 9, 2006 You can use the @ sign-@$result = $num / $num2;Or use the [url=http://php.net/error-reporting]error_reporting()[/url] funtion.Although, as Jenk said, fixing the problem is the best way.Orio. Link to comment https://forums.phpfreaks.com/topic/26673-hide-php-warning-message/#findComment-122033 Share on other sites More sharing options...
lucerias Posted November 10, 2006 Author Share Posted November 10, 2006 When i ran php file stored on the server, the warning message never showed out and however after i downloaded the same php source and executed on my localhost, the warning message came out. So i doubt whether the configuration is done externally but not inside the code because the code must be the same. Thank you. Link to comment https://forums.phpfreaks.com/topic/26673-hide-php-warning-message/#findComment-122400 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.