Why not just echo the ID var separately?  Less confusing with the escaped
quotes and all.  If you're not getting an ID var, it might be because you
didn't use the array quotes ($row['member_id']) as Larry mentioned.

Also be aware:
"If setcookie() successfully runs, it will return TRUE. This does not
indicate whether the user accepted the cookie."
http://us2.php.net/manual/en/function.setcookie.php


--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org


"Cesar Aracena" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> As extrange as can be, the echo function simply returns the following:
>
> 31536000);
>
> but not the setcookie, $varname and $value parts... What's this? Do I
havve
> a missconfiguration in php.ini file?
>
> Thanks,
>
> Cesar Aracena
>
> "Larry Brown" <[EMAIL PROTECTED]> escribió en el mensaje
> news:[EMAIL PROTECTED]
> > shouldn't $row[member_id] be $row['member_id'].  In case anyone can
profit
> > from this, when I find a function doesn't work right and I am using
> > variables in its execution I run an echo/die combination immediately
> before
> > the function to verify the data being fed to it is as it should be.  In
> this
> > example...
> >
> > ...
> > $id = $_SESSION["user"];
> > echo "setcookie(\"memberlogin\", ".$id.", ".time() +60*60*24*365.");";
> > die();
> > setcookie...
> >
> > What does this yeild?
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: Cesar Aracena [mailto:[EMAIL PROTECTED]
> > Sent: Friday, January 02, 2004 2:28 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] No cookie is being set?
> >
> >
> > Hi again,
> >
> > I have the following code to first start a session and then write a
> > cookie... is that so hard? Well it is starting the session but the
cookie
> is
> > not being set. see:
> >
> > $row = mysql_fetch_array($result);
> > $_SESSION["user"] = $row[member_id];
> > if ($_POST["autologin"] == "yes")
> > {
> >  $id = $_SESSION["user"];
> >  setcookie("memberlogin", $id, time()+60*60*24*365);
> >  header("Location: $CFG->wwwroot");
> >  exit();
> > }
> > else
> > {
> >  header("Location: $CFG->wwwroot");
> >  exit();
> > }
> >
> > What can it be? No error is posted.
> >
> > Thanks in advanced,
> >
> > Cesar Aracena
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php

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

Reply via email to