Jump to content


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


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

Recommended Posts


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!



Share this post

Link to post
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.

Share this post

Link to post
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

Share this post

Link to post
Share on other sites


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.