variables not recognised

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi Folk

I loaded a website onto a new webserver (from some ISP that I know little  
about and I noticed that even though everything seemed to be working fine,  
it does not actually recognise variables.

usually, if I have then $x  == 1 in my  
php file.  However, on this ISP it sure did not do this.

Is this
a. an old version of PHP
b. a security feature
c. something else or had to know


- Nicolaas  

Re: variables not recognised

windandwaves wrote:
Quoted text here. Click to load it

My guess is that your code relies on register globals being enabled. Since  
PHP 4.2 this directive is disabled by default, so $x should be referenced as  



Re: variables not recognised

Janwillem Borleffs wrote:
Quoted text here. Click to load it

Thank you, right on the ball!  I have asked them if I can change the php.ini  
file and I am using $_GET for now.

Thank you .

- Nicolaas  

Re: variables not recognised

If I were you I'd try to rewrite things without using register globals
(i.e. using $_GET and $_POST).  While it isn't a security risk in and
of itself, register globals does make it easier to write vulnerable

Besides, if you write your site without relying on register globals, it
will run on a host with or without it.  On the other hand, if you write
it using register globals, the site won't work without it.

Site Timeline