[PHP] Predefined variables not set?

2002-10-13 Thread Miles

When trying to get $_SERVER[QUERY_STRING] I am getting 'Undefined index 
QUERY_STRING' error

If there is a query string, e.g.  www.site.com/index.php?hello_world then it IS 
defined.  So it seems that PHP is complaining about undefined variables, rather than 
just outputting nothing.

How can I fix this?  I've had no problems until i reinstalled php today...

Cheers,

Miles



Re: [PHP] Predefined variables not set?

2002-10-13 Thread Chris Hewitt

Miles wrote:

than just outputting nothing.

How can I fix this?  I've had no problems until i reinstalled php today...

register_globals?

HTH
Chris



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Predefined variables not set?

2002-10-13 Thread Sascha Cunz

Am Sonntag, 13. Oktober 2002 10:04 schrieb Miles:
 When trying to get $_SERVER[QUERY_STRING] I am getting 'Undefined index
 QUERY_STRING' error

 If there is a query string, e.g.  www.site.com/index.php?hello_world then
 it IS defined.  So it seems that PHP is complaining about undefined
 variables, rather than just outputting nothing.

 How can I fix this?  I've had no problems until i reinstalled php today...

I think on your prior installation, error reporting level was set lower than 
on your new installation. The better way is to fix the script, that this 
condition doesn't occur at all -- 
if (isset($_SERVER['QUERY_STRING'])) { ... }

Sascha

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Predefined variables not set?

2002-10-13 Thread Oscar F

I'm pretty sure it's not $_SERVER[QUERY_STRING], it's 
$_SERVER['QUERY_STRING'] (note the ' instead of ).

HTH.

  Oscar F.-


Miles wrote:

 When trying to get $_SERVER[QUERY_STRING] I am getting 'Undefined index 
QUERY_STRING' error
 
 If there is a query string, e.g.  www.site.com/index.php?hello_world then it IS 
defined.  So it seems that PHP is complaining about undefined variables, rather than 
just outputting nothing.
 
 How can I fix this?  I've had no problems until i reinstalled php today...
 
 Cheers,
 
 Miles
 
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Predefined variables not set?

2002-10-13 Thread Mark Charette

In this context it makes no difference whether or not  or ' is used (
allows variable substitution within the quoted string, ' does not) since
there's no substitution taking place.

Insert a phpinfo() in the top of your code to see all the variables that
_are_ being set.

-Original Message-
From: Oscar F [mailto:[EMAIL PROTECTED]]

I'm pretty sure it's not $_SERVER[QUERY_STRING], it's
$_SERVER['QUERY_STRING'] (note the ' instead of ).

HTH.

  Oscar F.-

Miles wrote:

 When trying to get $_SERVER[QUERY_STRING] I am getting 'Undefined index
QUERY_STRING' error

 If there is a query string, e.g.  www.site.com/index.php?hello_world then
it IS defined.  So it seems that PHP is complaining about undefined
variables, rather than just outputting nothing.

 How can I fix this?  I've had no problems until i reinstalled php today...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php