[問題] input file submit 後抓不到值

看板Web_Design作者 (兔子)時間15年前 (2011/04/13 20:05), 編輯推噓1(104)
留言5則, 3人參與, 最新討論串1/1
節錄pic_manager.php中的程式碼 <?php echo $_FILES['newlogo']['name']; //這邊一直沒有值 ?> <form name="pic" action="pic_manager.php" method="post" > <table border="1"> <tr> <td>logo</td> <? $result=mysql_query("select * from picture where name='logo';"); $data=mysql_fetch_array($result); ?> <td><image src="<? echo $data['path']?>" width="100px"/></td> <td> <input type="file" name="newlogo" /> </td> </tr> <tr> <td> <input type="submit" name="uploadpic" value="上傳"/> </td> </tr> </table> </form> 請幫我看看是怎麼回事 還有 我可以用isset($_FILE['newlogo'])來判斷嗎? -- ◤ __ \__◢◤◢◤ ψhirabbitt ◤ ◢███◣ ◢███◣ 我不是m █████ █████ 我不是s ██ ███ 是溫柔 ██╱╲ ◥█████◣● 是傲嬌╱╱ ◥████ ˇ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 163.13.127.91

04/13 20:12, , 1F
<form>裡加上enctype="multipart/form-data"
04/13 20:12, 1F

04/13 20:17, , 2F
感謝QQ
04/13 20:17, 2F

04/13 20:21, , 3F
那$_file有isset的用法嗎?
04/13 20:21, 3F

04/14 10:23, , 4F
可以用 is_uploaded_file($_FILE[]['tmp_name']
04/14 10:23, 4F

04/14 10:23, , 5F
上面$_FILE => $_FILES 打錯 ..
04/14 10:23, 5F
文章代碼(AID): #1DfP60j5 (Web_Design)