Katherine Hall wrote:
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
gone.
first page:
print_r($_COOKI E);
$url = "../somepage.php";
$target = "parent";
$delay = "4";
echo '<meta http-equiv="refresh" content="'.$del ay.';url='.$url .'">';
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("myna me","Katerine Hall");
header("Locatio n: page2.php");
?>
A file called page2.php follows:
<?
print_r($_COOKI E);
?>
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,
randelld.