chelnov63 Posted July 29, 2008 Share Posted July 29, 2008 Havign a problem retrieving info from the $_FILES array when files are uploaded... here is the form: <form action="gallery_insert3.php" method="post" enctype="application/x-www-form-urlencoded" name="form1" id="form1"> <table align="left"> <?php for ( $counter = 1; $counter <= 3; $counter += 1) { ?> <tr valign="baseline"> <td height="30" align="right" nowrap="nowrap"><div align="left"></div></td> <td><label> <input name='<?php echo "image_source".$counter ?>' type="file" id="<?php echo "image_source".$counter ?>" size="32" /> </label></td> </tr> <?php } ?> <tr valign="baseline" bgcolor="#CCCCCC"> <td colspan="2" align="right" nowrap="nowrap"> <input type="submit" value="Next >>" /> </td> </tr> </table> </form> and this is the php file it is posted to: for ( $counter = 1; $counter <= 3; $counter += 1) { echo "name: ".$_FILES['image_source'.$counter]['name']; // the file names don't echo out all i get is 'name:' } ?> Am i missing something obvious? thanks in advance.. why isn't the above echoing out the files name which i am going to upload? Link to comment https://forums.phpfreaks.com/topic/117207-simple-file-uploading-question/ Share on other sites More sharing options...
PFMaBiSmAd Posted July 29, 2008 Share Posted July 29, 2008 The enctype of the form is incorrect. You might want to read the upload section in the php manual - http://www.php.net/features.file-upload Link to comment https://forums.phpfreaks.com/topic/117207-simple-file-uploading-question/#findComment-602899 Share on other sites More sharing options...
chelnov63 Posted July 29, 2008 Author Share Posted July 29, 2008 aaargh my mistake thanks for that Link to comment https://forums.phpfreaks.com/topic/117207-simple-file-uploading-question/#findComment-602901 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.