array with session
| From: | Laurence | Date: | Fri, 29 Nov 2002 12:58:51 +0000 |
| Subject: | array with session | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-126469@lists.php.net to get a copy of this message | ||
hello everyone,
I'm trying to get some images value from a checkbox putting them in a session to preserve the
data. The array works perfectly without the session_start() and session_register.
can anyone help?
html script
<html>
<head>
<title></title>
</head>
<body>
<form action="submit_information.php" method="post">
<input type="checkbox" name=Image[] value="Image_One">
<img src=".gif" name="Image_One"><br>
<input type="checkbox" name=Image[] value="Image_Two">
<img src=".gif" name="Image_Two"><br>
<input type="checkbox" name=Image[] value="Image_Three">
<img src=".gif" name="Image_Two"><br>
<input type="checkbox" name=Image[] value="Image_four">
<img src=".gif" name="Image_One"><br>
<input type="checkbox" name=Image[] value="Image_five">
<img src=".gif" name="Image_Two"><br>
<input type="checkbox" name=Image[] value="Image_six">
<img src=".gif" name="Image_Two"><br>
<input type="submit" value="submit">
</form>
</body>
</html>
php script: submit_information.php
<?php
session_start();
session_register("Image");
$count = count($Image);
for ($i=0; $i<$count; $i++)
{
echo $Image[$i];
}
//I also tried that
/*foreach ($Image as $i=> $Img)
{
$Img == $Image[$i];
echo $Img;
}*/
?>
---------------------------------
With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs