dark 0 Report post Posted January 20, 2005 HiIs it ok to use error-reporting(0) locally in a snippet of code that spits an undefined variable error?I found that fix and was wondering what does everybody do about error messages that keep poping up.ThanksPatrick Share this post Link to post Share on other sites
no9t9 0 Report post Posted January 21, 2005 my scripts don't have error messages... try to find out what's wrong and fix it. or try to do it a different way. there is always more than one way to do something in programming. Share this post Link to post Share on other sites
OpaQue 15 Report post Posted January 21, 2005 Turnning off the error reporting function can sometimes make it hard to track the errors.. So debugging becomes extremely difficult. You can use an include file on top to set this option for all the files. So while you are debugging you can temporarily disable it.The other option which you have is using the "@" symbol. If you preceed any function with it, the errors are suppressed but they are limited to that line of code only. Share this post Link to post Share on other sites
LuciferStar 0 Report post Posted January 21, 2005 try to make your codes work well,or try '@' before every function you have to use,like@count($emptyarray);@fopen("","w");if you do so,then no error message will be displayed. Share this post Link to post Share on other sites
dark 0 Report post Posted January 23, 2005 HiThis is the original poster. Thanks so much for the kind answers and the @ tip, I am going to try to use it asap.While browsing the web for answers to my problem, I came upon a snippet of code that showed how a variable that sometimes isn't defined creates an error with the parser. So including this variable code in an IF statement would prevent the error also.Like someone said above, there are several solutions to fix that.Thanks againPatrick Share this post Link to post Share on other sites