作者hirabbitt (兔子)
看板Web_Design
標題[問題] input file submit 後抓不到值
時間Wed Apr 13 20:05:18 2011
節錄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
推 itisjoe:<form>裡加上enctype="multipart/form-data" 04/13 20:12
→ hirabbitt:感謝QQ 04/13 20:17
→ hirabbitt:那$_file有isset的用法嗎? 04/13 20:21
→ kerash:可以用 is_uploaded_file($_FILE[]['tmp_name'] 04/14 10:23
→ kerash:上面$_FILE => $_FILES 打錯 .. 04/14 10:23