tejama Posted February 27, 2007 Share Posted February 27, 2007 Okay guys, I read the PHP manual on file uploading, wrote the following script and I'm having no luck. ----------------------------------------------- <form action='enter_item.php' method='post'> <input type="hidden" name="MAX_FILE_SIZE" value="30000" /> <p><table width='40%' border='0' cellpadding='1' cellspacing='1'> <tr> <td><b>Headline</b>:</td> <td><input type='text' name='headline'></td> </tr> <tr> <td valign='top'><b>Description</b>:</td> <td><textarea name='description' cols='50' rows='10'></textarea></td> </tr> <tr> <td><b>Price</b>:</td> <td><input type='text' name='price' size='7'></td> </tr> <tr> <td>Pic 1:</td> <td><input type='file' name='up1'></td> </tr> <tr> <td><input type='submit' value='Submit'></td> <td> </td> </tr> </table> </form> ----------------------------------------------- enter_item.php echo "Name: " . $_FILES['up1']['name']; ----------------------------------------------- This is just display "Name:" and nothing else. Can anyone point out what I'm doing wrong here? Thanks Link to comment https://forums.phpfreaks.com/topic/40285-solved-file-upload-issue/ Share on other sites More sharing options...
SharkBait Posted February 27, 2007 Share Posted February 27, 2007 Can you echo print_r($_FILES); ? That will at least print the contents of $_FILES out for you. Link to comment https://forums.phpfreaks.com/topic/40285-solved-file-upload-issue/#findComment-194887 Share on other sites More sharing options...
tejama Posted February 27, 2007 Author Share Posted February 27, 2007 The result of print_r($_FILES) is: Array ( ) 1 Link to comment https://forums.phpfreaks.com/topic/40285-solved-file-upload-issue/#findComment-194888 Share on other sites More sharing options...
tejama Posted February 27, 2007 Author Share Posted February 27, 2007 Got it...I forgot to add "enctype="multipart/form-data" to the form tag. Link to comment https://forums.phpfreaks.com/topic/40285-solved-file-upload-issue/#findComment-194890 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.