| | Hi Is 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. Thanks Patrick |
|
|
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.
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.
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.
Hi
This 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 again Patrick
Similar Topics
Keywords : rid, errors
I always thought these worked, but suddenly they no longer do?! (5) Hi i'm dan from new zealand, right next to my home land australia. I have been writing php (5) Hi, I am using the header function to redirect after the processing of the form. I have to specify mysql errors (5) process_login.php: Process the login. $host = "localhost";// the host that u are connecting need to know what im doing wrong (3) ok please help me!! im trying to get this tournamt/leage ladder script working, its with php setcookie errors (5) I'm having troubles with my authentication function, if the the users uses wrong login info, it cant find whats wrong :( (3) I am working on my guestbook, better to say I am transfuring it from old to new site, but I got some Looking for rid, errors
|
|
![]() Getting Rid Of Errors |
| ADD REPLY / Got an Opinion! | Remove these ADs! | RAPID SEARCH! | Free Web Hosting | [X] |
|
Express your Opinions, Thoughts or Contribute more info. to help others. Ask your Doubts & Queries to get answers, So that "Together We can help others!" |
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP. | 500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE |
|