RE: [PHP-WIN] undefined variable

From: Date: Wed, 06 Feb 2002 09:01:32 +0000
Subject: RE: [PHP-WIN] undefined variable
Groups: php.windows 
Request: Send a blank email to php-windows+get-11860@lists.php.net to get a copy of this message
> 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

« previous php.windows (#11860) next »