RE: [PHP-WIN] Problems with cookies and post variables
| From: | Rich Gray | Date: | Tue, 06 Aug 2002 22:36:28 +0000 |
| Subject: | RE: [PHP-WIN] Problems with cookies and post variables | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-15141@lists.php.net to get a copy of this message | ||
Kieran
Have you tried echoing a meta http refresh tag instead of the
header("Location...)?
Rich
-----Original Message-----
From: Kieran Hall [mailto:kieran_hall@blueyonder.co.uk]
Sent: 06 August 2002 05:37
To: php-windows@lists.php.net
Subject: [PHP-WIN] Problems with cookies and post variables
I am running IIS 5 on win XP pro and am having a few problems passing
variables...
index.php
------------
<?PHP
if(IsSet($_COOKIE['login'])) {
print('<td class=tbl_info>Hello $_COOKIE['login'], you
are logged in</td>');
}
else {
print('
<form name=login action=http://localhost/bin/login.php
method=post>
<td>User: <input type=text name=user width=50> <input
name=submit type=submit value=Login!></td>
</form>
');
}
?>
------------
login.php
------------
<?PHP
setcookie('login', $_POST['user'], time()+3600);
header("Location: http://localhost/index.php");
?>
------------
The result is that the form remains, where I expected the hello message
to be. Does anyone know what the problem is likely to be?
Thanks in advance,
Kieran Hall.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php