Jump to content

Simple file uploading question:


chelnov63

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.