RE: [PHP-WIN] undefined variable
| From: | Pac mon | Date: | Wed, 06 Feb 2002 13:29:26 +0000 |
| Subject: | RE: [PHP-WIN] undefined variable | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-11865@lists.php.net to get a copy of this message | ||
or simply declare your variables:
var $user1, $password1;
Hello everyone,
I have a small question:
How can I get rid of "Warning: Undefined variable: user1(&
password1) in C:\WebShare\wwwroot\netk\5\login.php on line 4"
in that program?
<?php
include ("config.php");
session_register("userpassword");
if($user1==$USER && $password1==$PASSWORD) {
$userpassword = $user1.$password1;
header("Location:index.php");
exit();
}
?>
-[snip]-
the proper way of doing this would be
if (isset($user1) && isset($password1) && $user1==$USER &&
$password1==$PASSWORD) {
...
Or you can just turn off warnings in php.ini, as Nicole suggests :)
/Martin
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com