【发布时间】:2016-02-15 19:36:12
【问题描述】:
这是我的 HTML:
<!DOCTYPE html>
<html>
<head>
<title>This is where we add Party.</title>
</head>
<body>
<form action="viewParties.php" method="post" enctype="multipart/form-data">
PartyList:<br>
<input type="text" name="partylist"><br>
<input type="file" name="pafile"><br><br>
President:<br>
<input type="text" name="president"><br>
<input type="file" name="pfile"><br><br>
Vice President:<br>
<input type="text" name="vicepresident"><br>
<input type="file" name="vpfile"><br><br>
Secretary:<br>
<input type="text" name="secretary"><br>
<input type="file" name="secpfile"><br><br>
<input type="submit" name="submit"><br><br>
</form>
</body>
</html>
基本上,我想要让 POST 方法同时获取名称和文件位置。但是当我在另一个 PHP 文件中 print_r($_POST) 时,它只显示名称。有谁知道如何解决这个问题?
【问题讨论】:
-
使用 print_r($_FILES);用于打印文件值
-
这样写
enctype="multipart/form-data" -
嗯。 =) 有点晚了,但谢谢你/ =D