PHP 4.0 Bug #3529: Can't use undefined variables
| From: | chrisbolt at home dot com | Date: | Fri, 18 Feb 2000 00:31:56 +0000 |
| Subject: | PHP 4.0 Bug #3529: Can't use undefined variables | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-15669@lists.php.net to get a copy of this message | ||
From: chrisbolt@home.com
Operating system: Linux 2.2.13
PHP version: 4.0 Latest CVS (18/02/2000)
PHP Bug Type: Scripting Engine problem
Bug description: Can't use undefined variables
The following script:
$dblink = @mysql_pconnect($dbhost, $dbuser, $dbpass);
if (!$dblink) {
echo("<HTML>\n<BODY>\nThere was an error connecting to the database server.
Please check your settings and verify that your database server is up, then try
again.\n</BODY>\n</HTML>\n");
exit;
}
$query = "SELECT access FROM users WHERE username = '" . $PHP_AUTH_USER .
"' AND password = '" . $PHP_AUTH_PW . "'";
$result = mysql_db_query($dbname, $query, $dblink);
if (mysql_num_rows($result) == 0 || mysql_error()) {
authenticate();
}
works fine in php 3.0.14, but when I try it with php4b3 and with today's CVS on snaps.php.net,
the $query = line produces two notices "using undefined variable" and prevents
authenticate() from sending it's header() call. I have error_reporting set to 7 in both php.ini
and php3.ini