You are here: Re: sometimes a cookie sometimes not a cookie? « All PHP « IT news, forums, messages
Re: sometimes a cookie sometimes not a cookie?

Posted by Wenting, Marcel on 09/28/96 11:57

Hello Frits,

I had this also, try to insert your domain and path into the set_cookie
function according to the php.net function description.

bool setcookie ( string name [, string value [, int expire [, string
path [, string domain [, bool secure [, bool httponly]]]]]] )

this will most prolly solve this problem.

Marcel

Frits van Leeuwen wrote:
> I still do not understand.
>
> Index.php
> ----------
> <?php
> setcookie("Leeuwendeel");
> // controleer eerst of het cookie bestaat
> if(isset($_COOKIE['LeeuwendeelTaal']))
> {
> // cookie bestaat, lees de waarde uit
> $cookie_var = $_COOKIE['LeeuwendeelTaal'];
> // druk de waarde eventueel af (dit kan ook rechtstreeks natuurlijk)
> echo "cookie waarde: ".$cookie_var;
> }
> else
> {
> // cookie bestaat niet
> echo "cookie bestaat niet.<br>";
> echo "Welke taal kiest u? <br>";
> "<a href="taal_nl.php">Nederlands</a> of <a
> href="taal_en.php">Engels</a>?";
> }
> ?>
>
> taal_nl.php
> -----------
> <?php
> setcookie("LeeuwendeelTaal", "nl", time()+7200));
> Echo "De taal is Nederlands.";
> ?>
>
> taal_en.php
> -----------
> <?php
> setcookie("LeeuwendeelTaal", "en", time()+7200));
> Echo "The language is English.";
> ?>
>
> I don't see a cookie at the cookie directory.
> And also I dón't see any text at my screen.
>
> Who knows what's wrong?
>
>

 

Navigation:

[Reply to this 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

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