|
Posted by Andy Hassall on 09/25/06 23:00
On Tue, 26 Sep 2006 00:50:14 +0200, "Frits van Leeuwen" <fleeuwen@wanadoo.nlx>
wrote:
>I call from index.php this file: (Taal_nl)
>
><?php
>setcookie("LeeuwendeelTaal", "nl", time()+3600*24); // 1 dag
>echo "Cookie is: ". $_COOKIE["LeeuwendeelTaal"] . '<br>';
>echo "Cooke is: ". $LeeuwendeelTaal;
>header('Location: http://www.Leeuwendeel.info/index.php');
>exit;
>?>
>
>nothing happend.
>
>when I remake lins. like this:
><?php
>setcookie("LeeuwendeelTaal", "nl", time()+3600*24); // 1 dag
>echo "Cookie is: ". $_COOKIE["LeeuwendeelTaal"] . '<br>';
>echo "Cooke is: ". $LeeuwendeelTaal;
>/* header('Location: http://www.Leeuwendeel.info/index.php');
>exit; */
>?>
>
>I see this:
>Cookie is:
>Cooke is:
>
>after refresh I see:
>Cookie is: nl
>Cooke is: nl
>
>I like to see this, without a refresh.
You can't, that's not how it works. $_COOKIE is only populated when the
browser sends the cookie back to the server, which is only on the next request.
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Navigation:
[Reply to this message]
|