Try putting the exit() before the redirect, and see if there's an error when
you attempt to set the cookie.


"Cesar Aracena" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 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
>    {
>     $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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to