plz help with multiple upload(newbie)
Posted: Sun Aug 16, 2009 9:27 pm
i have been learning php from couple month earlier.
i cant figure out error going on with this code
i have error
Notice: Undefined index: file in C:\wamp\www\multiple_upload\multiple_upload1.php on line 11
please please help i have working with it from last 24 hr
multiple_upload1.php here is error going on
multiple_uplaod2.php (just for testing)
thanking you in advance
i cant figure out error going on with this code
i have error
Notice: Undefined index: file in C:\wamp\www\multiple_upload\multiple_upload1.php on line 11
please please help i have working with it from last 24 hr
Code: Select all
html>
<body>
<form name="form" action="multiple_upload1.php" enctype="multipart/form-data" method="post">
<p>Enter number of the uploads </p>
<p><input type="text" name="uploadneed" id="uploadneed" maxlength="1" ></p><br/>
<input type="submit" name="Submit" value="Submit" >
</form>
</body>
</html>Code: Select all
<html>
<body>
<form name="form1" method="post" action="multiple_upload2.php" enctype="multipart/form-data">
<?php
$uploadnumber=$_POST['uploadneed'];
for($x=0;$x<$uploadnumber;$x++)
{?>
<input name="uploadFile <?php echo $x;?>" type="file" id="uploadFile <?php echo $x;?>" />
<?php echo 'Upload:'.$_FILES['uploadFile'.$x]['name'];//[color=#40FF80]here is error[/color]
}
?>
<input type="hidden" name="uploadnumber" value="<?php echo $uploadnumber; ?>" />
<input type="submit" name="Submit" value="Submit" />
</form>
</body>
</html>Code: Select all
<?php
$uploadnumber=$_POST['uploadnumber'];
echo $uploadnumber;
for($x=0;$x<$uploadnumber;$x++)
{
$file_name=$_FILES['uploadFile'.$x]['name'];
echo $file_name;
}
?>