Cookies
Posted: Mon Nov 24, 2003 8:46 am
I can properly set a cookie, but I cannot retrieve it. I get the error of Notice: Undefined index: testcookie in c:\ftp\users\straterra\cgi-bin\getbox2.php on line 2. The code for my cookie retrievel is
<?php
$cook = $_COOKIE['testcookie'];
echo $cook;
?>
And the code for saving the cookie is
<?php
$song = $_POST['dropdown'];
setcookie ("testcookie", $song);
echo $song;
print_r ($_COOKIE);
?>
If anyone could help, I would greatly appreciate it.
<?php
$cook = $_COOKIE['testcookie'];
echo $cook;
?>
And the code for saving the cookie is
<?php
$song = $_POST['dropdown'];
setcookie ("testcookie", $song);
echo $song;
print_r ($_COOKIE);
?>
If anyone could help, I would greatly appreciate it.