Jump to content

Variables


pea_1

Recommended Posts

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.

 

Link to comment
https://forums.phpfreaks.com/topic/57572-variables/
Share on other sites

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 :)

Link to comment
https://forums.phpfreaks.com/topic/57572-variables/#findComment-284967
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/57572-variables/#findComment-284980
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.