Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am trying to set a cookie and use it later, but as soon as put a redirect
or anything, I loose it.

So when I first print it out, it exists. When I go to my redirect page it's
first page:

$url = "../somepage.php";
$target = "parent";
$delay = "4";
echo '<meta http-equiv="refresh" content="'.$delay.';url='.$url.'">';

Re: setcookie

I should mention that somepage.php has frames.


Quoted text here. Click to load it

Re: setcookie

Katherine Hall wrote:

Quoted text here. Click to load it

How do you set your cookie?

You'll have to show us a little more code before I can advise where you
are going wrong - And you could/should used the header() function to
redirect as opposed to the meta http-equiv tag you're using.

Start simple first, then work your way from there - Thus, create a
simple page that says something like

A file called page1.php follows:

setcookie("myname","Katerine Hall");
header("Location: page2.php");

A file called page2.php follows:

The above should work - when you've tweaked with it a bit and got it
working, then implement the code in to your real life scenario.

Hope that helps,

Site Timeline