亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

PHP開發(fā)之前端上傳表單

首先將表單代碼貼出來:

<html>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no" />
<body>
<form action="upload.php" method="post"  enctype="multipart/form-data">
    <label for="file">文件名:</label>
    <input type="file" name="file" id="file" />
    <br />
    <input type="submit" name="submit" value="上傳" />
</form>
</body>
</html>

這其實是一個簡單form表單,但是值得注意的是enctype="multipart/form-data",enctype 屬性規(guī)定了在提交表單時要使用哪種內(nèi)容類型,enctype="multipart/form-data"是上傳二進制數(shù)據(jù); form里面的input的值以2進制的方式傳過去。這個是上傳功能表單里面最重要的屬性,要注意。

再一個要注意的是action="upload.php" ,method="post"。既然是上傳就會有上傳到的地方和以什么方式上傳。action="upload.php"這個屬性是將表單內(nèi)容發(fā)向何處。

method="post"是以何種方式傳遞數(shù)據(jù)。

表單頁面還是很簡單的,不過也要自己親自動手嘗試一下,這樣才會記憶深刻。

Weiter lernen
||
<html> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="format-detection" content="telephone=no" /> <body> <form action="upload.php" method="post" enctype="multipart/form-data"> <label for="file">文件名:</label> <input type="file" name="file" id="file" /> <br /> <input type="submit" name="submit" value="上傳" /> </form> </body> </html>
einreichenCode zurücksetzen