note 19544 deleted from language.types.null by didou
| From: | didou@php.net | Date: | Sun, 29 Aug 2004 21:40:05 +0000 |
| Subject: | note 19544 deleted from language.types.null by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-75591@lists.php.net to get a copy of this message | ||
Note Submitter: joemamacow at hotmail dot com
----
I have particularly found that the NULL value is very helpful when using form and script on the same
page.
For example:
if(isset($password) AND $password = $passwd):
{
echo "You're logged in!";
}
elseif(isset($password) AND $password != $passwd):
{
$password = NULL;
echo "Sorry, wrong password, <a href=$PHP_SELF>log in again</a>.";
}
else:
{
echo "Log in!
<input type=text name=password>
<input type=submit>";
}
endif;
So, when the user geta the wrong password message, the password is set to NULL, making it unset,
therefore when the page is refreshed, it will go back to the password from.