Reply to Re: setcookie not working

Your name:

Reply:


Posted by Frits van Leeuwen on 09/26/06 10:00

> >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.
>
Thanks Andy for answare.
I have found my problem. Thanks

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация