pea_1 Posted June 28, 2007 Share Posted June 28, 2007 I uploaded some of my scripts onto my friends website and i got errors. I could only correct the errors by using functions like isset. I was wondering why these errors appear when on my friends server and not mine? Is it a setting in the phpini? It's quite annoying as the scripts work fine even with the errors. An example of a complaint is: if($var) which had to be changed to if(isset($var)) and if($var){ $word = "word"; } echo $word; had to be changed to if(isset($var)){ $word = "word"; } else { $word = ""; } Which i think is pointless. Quote Link to comment Share on other sites More sharing options...
trq Posted June 28, 2007 Share Posted June 28, 2007 It's quite annoying as the scripts work fine even with the errors. That may be, but poor coding is poor coding. The reason they work fine on your and not his is because his server has stricter error settings. Quote Link to comment Share on other sites More sharing options...
pea_1 Posted June 28, 2007 Author Share Posted June 28, 2007 I guessed that.. and most scripts i download don't use isset, so maybe it isn't a common setting to have. The response i would rather have would be what the setting is to see if i can get my hosts to turn it off. I've only learned php from other scripts, so blame them for my poor coding Quote Link to comment Share on other sites More sharing options...
trq Posted June 28, 2007 Share Posted June 28, 2007 You could simply turn notices off, Ide recommend changing your code though, and get in the habbit of making sure variables exist before using them. Quote Link to comment Share on other sites More sharing options...
pea_1 Posted June 28, 2007 Author Share Posted June 28, 2007 Ofcourse i will, but i've coded that way for quite a lot of my work so i can only correct some of it. Quote Link to comment Share on other sites More sharing options...
trq Posted June 28, 2007 Share Posted June 28, 2007 so i can only correct some of it. I know. I'm just letting you know what the problem is and saying you should get in the habbit of not doing it. One good piece of advice would be to turn your error reporting on as strict as possible while developing. This way you are forced to fix all issues as they pop up, not after you've finished an entire application and moved it to another server. 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.