Are you on PHP >= 4.1 ?

Try this:

<?
session_start();
print_r($_POST['Image']);               // should print out your
                                        //checkbox array

$_SESSION['Image'] = $_POST['Image'];   // instead of session register
print_r($_SESSION['Image']);            // should print out your
                                        // checkbox array from the session

?>

This should test if
a) $_POST['Image'] is being populated
b) $_SESSION['Image'] is being populated

Then, to do what you were trying to achieve:

<?
session_start();
$_SESSION['Image'] = $_POST['Image'];

foreach($_SESSION['Image'] as $key => $val)
    {
    echo $val;
    }

// OR //

$i = 0;
while($i < count($_SESSION['Image']))
    {
    echo $Image[$i];
    $i++;
    }
?>


Justin



on 29/11/02 11:58 PM, Laurence ([EMAIL PROTECTED]) wrote:

> 
> 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
> 

Justin French
--------------------
http://Indent.com.au
Web Development & 
Graphic Design
--------------------


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to