文章出處

<form name="article" method="post"  enctype="multipart/form-data" action="<?php echo $this->createUrl('/guoarticle/file'); ?>">
    <table width="829" height="206" border="1">
        <tr>
            <td width="97">新聞標題:</td>
            <td width="616"><input type="text" name="newname"/></td>
        </tr>
        <tr>
            <td>圖片:</td>
            <td><input type="file" name="file"/></td>
        </tr>
        <tr><td><input type="submit" value="提交"/></td></tr>
        </table>
    </form>

 

上面是html 代碼,下邊是 php 代碼。

<?PHP

        echo "<pre>";
        print_r($_POST);
        var_dump($_FILES);

結果為:

Array
(
    [newname] => ff
)
array
  'file' => 
    array
      'name' => string 'a4.jpg' (length=6)
      'type' => string 'image/jpeg' (length=10)
      'tmp_name' => string 'D:\wamp\tmp\php122.tmp' (length=22)
      'error' => int 0
      'size' => int 106987

 


文章列表


不含病毒。www.avast.com
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 大師兄 的頭像
    大師兄

    IT工程師數位筆記本

    大師兄 發表在 痞客邦 留言(0) 人氣()