PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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
$_FIELS['uploadFile...'] is not yet set so this is probably the error.
What you are also going to want to change is the name part of the file type element. Change it so that it can be posted as an array by using square brackets:
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'];//here is error //i beleive u wouldnt need this line.
//try to remove this line and execute the code. There is no point in echoing uploaded file names
// when u didnt have any files that are uploaded in this file.
}
?>
thanks for reply susisra
while i have remove the line but when u move to multiple_upload2.php
u again have same problem i.e
Notice: Undefined index: uploadFile0 in C:\wamp\www\multiple_upload\multiple_upload2.php on line 6
for($x=0;$x<$uploadnumber;$x++)
{?>
<input name="uploadFile<?php echo $x;?>" type="file" id="uploadFile<?php echo $x;?>" />
//u left a space after uploadFile and the php echo statement. Thats what created the whole problem.
<?php
}
?>