|
Posted by Vincent Delporte on 02/08/07 22:55
On Thu, 08 Feb 2007 23:26:35 +0100, Vincent Delporte
<justask@acme.com> wrote:
>Any idea why this redisplays the form even when filling the two fields
>in the form?
Found it: You have to close the window. I though just hitting F5 after
changing a script was enough to start afresh.
I'll have to find a way to sleep() after displaying the result and
reload the page:
<?php
$login = (isset($_POST["login"]) and !empty($_POST["login"])) ?
$_POST["login"] : NULL;
$password = (isset($_POST["password"]) and
!empty($_POST["password"]))? $_POST["password"] : NULL;
if(is_null($login) or is_null($password)) {
?>
<form action="<?php echo $PHP_SELF; ?>" method=POST>
Login: <input type="text" id ="login" name="login"
size="20" value=""><br>
Pass: <input type="password" id="password"
name="password" size="10" value=""><br>
<input type="submit" value="OK">
</form>
<?php
} else {
print "login = $login, password = $password";
//doesn't work : above not shown
sleep(3);
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: http://localhost" . $PHP_SELF);
}
?>
Thanks guys.
Navigation:
[Reply to this message]
|