lucerias Posted November 9, 2006 Share Posted November 9, 2006 How to do the configuration to hide the PHP warning message? Thank you. Quote Link to comment Share on other sites More sharing options...
Jenk Posted November 9, 2006 Share Posted November 9, 2006 by fixing the problem. Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.