Re: Undefined variable errors since upgrade to PHP4.0.3pl1
| From: | Andy Hoffman | Date: | Thu, 26 Oct 2000 13:58:50 +0000 |
| Subject: | Re: Undefined variable errors since upgrade to PHP4.0.3pl1 | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-3517@lists.php.net to get a copy of this message | ||
"Ulrich, Eric J" wrote:
> I use an if statement to check if a variable is set ex:
> if ($data)
>
> and very since I upgraded to 4.0.3pl1 from 4.0.2 I get this.
> Warning: Undefined variable: data in c:\inetpub\wwwroot\whatever.php on line
> 15
> Is there a setting or some to do to make this stop.
Check to make sure "register_globals" is set to On in your php.ini. However,
it's better (doesn't slow down php as much) if you set "track_vars" to On and
"register_globals" to Off - register_globals adds a significant amount of
overhead to php's execution time... then you can get at your form data via
$HTTP_GET_VARS and $HTTP_POST_VARS associative arrays.... $HTTP_GET_VARS["data"]
in the case of something passed via the URL line.
The reason this changed is more than likely the newer php.ini in 4.0.3 didn't
have register_globals set to On by default.
--
Andy Hoffman
Web Developer
Bristol-Myers Squibb
email: andy.hoffman@bms.com