It worked but not at all. I placed the setcookie() function in a folder
that's under the main one. When displaying the cookie like you told me, now
appears right just in the .php files under the same folder of the
setcookie() function, but not in the other (like the site's main pages)...
¿?¿?¿?

I didn't put any path or domain argument... just the name, value and time...

Thanks, Cesar

"Jim & Sara Feldman" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
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
>    {
>     $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


--
Jim Feldman
14 Linda Lane
Newton, MA 02461

617-527-0509

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

Reply via email to