Hello,
I have PHP 4.06 and MySQL 3.23 installed on a Win2k SP2 Professional server running IIS5.0. Everything works just fine, but for one thing. The PHP environment doesn't preregister or allow reference to nondefined variables at runtime, either environment or script specific.
For example, when I try to check for the existence of the environment variable QUERY_STRING using the following code
if (!$QUERY_STRING) { code };
<b>or</b>
if ($QUERY_STRING == "") { code };
I get an undefined variable warning. When I check the PHP environment with phpinfo() there is no QUERY_STRING variable listed. However, when I run phpinfo() on an Apache server, QUERY_STRING is listed, albeit empty.
If I try to do the same with script variables, the same thing happens.
I also get warnings when I try to reference an undefined index in an array.
The script continues to process as normal, I just don't want to see the warning message. I turned off warnings in php.ini, but now I don't get ANY warnings at all.
Does anyone know how to reference variables that are undefined, whether environment or local, on IIS like Apache does?
Thanks!