session not carrying...why?
| From: | Ryan A | Date: | Thu, 31 Jul 2003 21:27:19 +0000 |
| Subject: | session not carrying...why? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-157826@lists.php.net to get a copy of this message | ||
Hi,
I seem to be setting the session properly but its not showing on the next
page...any idea why?
I am sending data to save.session.php via checkboxes like so:
<input name="hide[noPlatform]" type="checkbox" id="noPlatform"
value="1>
Heres my code:
<?php
$vars = Array('noPlatform','noPrice','noSfee','noSpace');
$_SESSION['hide'] = $_POST['hide']; // create a session for each one
"checked"
$checked = array_keys($_SESSION['hide']); //to check if its "checked"
$not_checked = array_diff($vars,$checked); // check which are not "checked"
print_r($checked); //working
echo "<br>..";
print_r($not_checked); //working
print_r("<br><br>".$_SESSION['hide']['noPlatform']);
//this prints 1
echo "<br>".$_SESSION['hide']['noPrice']; //this prints 1
if (isset($_SESSION['hide']['noPlatform']))
{ echo "blah blah"; } // this is printing
else {echo "You are doing something wrong";}
?>
then in another page I have:
<?php
session_start();
header("Cache-control: private"); //IE 6 Fix
error_reporting (E_ALL);
?>
<html>
<head>
<title>BestWebHosters.com - Compare </title>
<meta http-equiv="Content-Type" content="text/html;">
</head>
<body bgcolor="#ffffff">
<?php echo "the value is:".$_SESSION['hide']['noPlatform']; ?>
.....
and this gives me:
Notice: Undefined index: hide in
c:\phpdev\www\bwh\project\customize.shared.php on line 14
the value is:
What am i doing wrong?
I checked all my includes every last one of the have a session_start etc...
Please help.
Cheers,
-Ryan
We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com