Re: No COOKIE Set?
| From: | Jim & Sara Feldman | Date: | Thu, 01 Jan 2004 18:40:11 +0000 |
| Subject: | Re: No COOKIE Set? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-173607@lists.php.net to get a copy of this message | ||
Cesar:
I think that the problem is the array in the "echo" statement. I have found that I have to do something
like:
$simple = $_COOKIE["MemberId"];
echo "Member ID = $simple";
Hope that helps.
Jim
Hi all, My head is about to explode here... I am trying to setup a cookie for every new user that registers in my site and right after that, to send them to the home page... is that so difficult? apparently yes... It does redirect, but when I try to "echo" the $MemberId cookie with: echo $_COOKIE["MemberId"]; Nothing happens... nothing is displayed... also, I can't find where these cookies are being stored. I am developing under WinXP, latest PHP and latest MySQL... other cookies are being stored very well, but I don-t know where... I'm displaying at http://localhost/..... øøø??? Here's my script: if ($use_same_data == "yes") // One kind of information stored { $query = "INSERT INTO members_info ....... )"; $result = mysql_query($query); $id = mysql_insert_id(); } elseif ($use_same_data == "") // Other kind of choice of information for shipping address {-- Jim Feldman 14 Linda Lane Newton, MA 02461 617-527-0509$query = "INSERT INTO members_info .......)"; $result = mysql_query($query); $id = mysql_insert_id();} if (!$result) {echo "Error code here";} else {setcookie ("MemberId", $id, time()+31536000); header ("Location: $CFG->wwwroot"); exit();} Thax in advanced, Cesar