problems with cookies

From: Date: Mon, 02 Sep 2002 17:31:03 +0000
Subject: problems with cookies
Groups: php.general 
Request: Send a blank email to php-general+get-114943@lists.php.net to get a copy of this message
Hi all, I'm using a cookie like this: <<setcookie("cookiename1","$domin","timeset()+1800");>> at the top of my script. <<$domin>> is a text field that belongs to a post form. This form is in <<function one();>> well, i try use <<$domin>> in <<function two();>> writing <<$_COOKIE['cookiename1'];>> Here you are the code: <? setcookie("cookiename1","$domin","timeset()+1800"); $cookiename1=$domin; echo $cookiename1; // here it works ?> --- HTML code --- <? function one(){ ?> --- HTML code --- <input name="domin" type="text" size="40" maxlength="63"> --- HTML code --- <? } function two(){ $othervar=$_COOKIE['cookiename1']; echo $othervar; // here it doesn't work ?> --- HTML code --- <? } ?> --- HTML code --- What am I doing wrong? Any tips? Any Ideas? Thanks for help Peace & Love skitum

« previous php.general (#114943) next »