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
Share on other sites

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.

Link to comment
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.