|
Posted by Captain Paralytic on 02/08/07 14:52
On 8 Feb, 14:35, Vincent Delporte <just...@acme.com> wrote:
> On Thu, 08 Feb 2007 13:48:42 +0100, Vincent Delporte
>
> <just...@acme.com> wrote:
> >//BAD if(!$login or !$password) {
> >//BAD if(empty($login) or empty($password)) {
>
> This doesn't work either:
>
> //BAD if(is_null($login) or is_null($password)) {
I just tried this and it seems to work fine:
<?php
if(!$PHPSESSID) {
//First time: Let's check login/passwd
//BAD $login = isset($_POST["login"])? $_POST["login"] : '';
$login = ($_POST["login"])? $_POST["login"] : NULL;
$password = ($_POST["password"])? $_POST["password"] : NULL;
if(!$login or !$password) {
?>
<form action="<?php echo $PHP_SELF; ?>" method=POST>
Login: <input type="text" name="login"
size="20" value=""><br>
Pass: <input type="password" name="password"
size="10" value=""><br>
<input type="submit" value="OK">
</form>
<?php
} else {
//Shown after clicking on OK, even with
//one of the fields empty!
print "login = $login, password = $password";
}
} else {
print "session = ". $PHPSESSID . "<p>";
}
?>
Navigation:
[Reply to this message]
|