Jump to content

Keep getting errors ... but not on other servers :-s


tazmaniac

Recommended Posts

Hello,

i have a weird problem. I am trying to write some code and try it out on my pc. Where i installed php4 and mysql.

The thing is that i keep getting errors when i try to output the code:

Notice: Undefined variable: common in c:\inetpub\wwwroot\magazijn\test2.php on line 12
Notice: Undefined variable: PHP_SELF in c:\inetpub\wwwroot\magazijn\test2.php on line 67

The weird thing is that when i run the php file on the server of my hosting i dont get those errors!
My guess is, it has something to do with the php.ini file.
But in a million years, i got no id of what i have to change.

Maybe you guys can help me out???? :-)

thnx in advance!

greetz

Taz
Link to comment
Share on other sites

If you're using varibaled like $PHP_SELF then it looks like you other sever has the dreded register_globals turn On and your local server install on your pc has this directive turned Off!

Having register globals off is recommend as when its on it can open up big securiity holes within your script. As you can set variables anywhere and php will use then, where as having it Off doesn't just create any old variables.

So if you had a form on form.php and you where submitting the form to send.php then I can just go to send.php and enter what I liked after send.php such as send.php?var1=somethingnasty and if you used var1 in your code php will use what ever is set in the url! When register_globals is off you use special variables called superglobal arrays.
Link to comment
Share on other sites

since you mention the $PHP_SELF variable, it makes me wonder if your host has register_globals turned ON and you have it set to OFF on your PC. the preferred flag is definitely OFF, but you would have to modify your code to allow for that. for instance, instead of simply using $PHP_SELF, you should use $_SERVER['PHP_SELF'].

hope this helps
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.