multi-file upload - $_POST not working...

From: Ben (crescent_au_at_yahoo.com)
Date: 09/23/04


Date: 22 Sep 2004 23:53:06 -0700

Hi everybody!
I have a multi-file upload form... Please looks at my code below. It's
in an initial stage. I'm trying to display the values of each text box
when I press "upload" but it doesn't seem to work... i don't know
what's the problem.. I'm using PHP5.

<html>
  <head>
  </head>
  <body>
<?php
        function ifcond($i) {
                if ($i > 9) {
                        return $i;
                }
                else {
                        return '0'.$i;
                }
        } //end function ifcond()
        for ($i=1; $i < 11; $i++) {
            $image[$i - 1] = $_POST[`echo 'image'.ifcond($i);`];
        }
        print_r($image);
?>
        
    <form action="<?php echo $_SERVER['../PHP_SELF']; ?>"
method="post">
        <?php
        for ($i=1; $i < 11; $i++) { ?>
        Image<?php echo ifcond($i); ?>:
        <input type="file" name="image"<?php echo ifcond($i); ?> /><br /><br
/>
        <?php } ?>
        <input type="submit" value="Upload" /></p></form>
    </form>
  </body>
</html>

Thanx!
Ben



Relevant Pages