Re: undefined variable
| From: | Nicole Amashta | Date: | Tue, 05 Feb 2002 14:59:48 +0000 |
| Subject: | Re: undefined variable | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-11852@lists.php.net to get a copy of this message | ||
In your php.ini, replace your error_reporting line with this one:
error_reporting = E_ALL & ~E_NOTICE
That should get rid of the warnings since pre-defining vars in PHP isn't
really required (as in Java).
Good luck,
~Nicole Amashta
www.aeontrek.com
"Bz" <bz586@163.com> wrote in message
news:20020205080900.075321C62D4A9@sm4.163.com...
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();
}
?>
<HTML>
<HEAD>
<TITLE>login</TITLE>
<HEAD>
<BODY>
<FORM action="<? echo $PHP_SELF ?>" method="POST">
<TABLE border="0" width="400">
<TR>
<TD>account£º
<INPUT type="text" name="user1">
<TD>password£º
<INPUT type="password" name="password1">
</TD>
</TR>
<TR>
<TD>
<INPUT type="submit" value="login">
<INPUT type="reset" value="cancel">
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>