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"<?p hp echo ifcond($i); ?> /><br /><br
/>
<?php } ?>
<input type="submit" value="Upload" /></p></form>
</form>
</body>
</html>
Thanx!
Ben
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"<?p hp echo ifcond($i); ?> /><br /><br
/>
<?php } ?>
<input type="submit" value="Upload" /></p></form>
</form>
</body>
</html>
Thanx!
Ben
Comment