Php POST方法不接受文件输入
这是我的HTML:Php POST方法不接受文件输入,php,file,post,methods,Php,File,Post,Methods,这是我的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> &l
<!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>
这就是我们加入派对的地方。
PartyList:
主席:
副主席:
秘书:
基本上,我希望POST方法同时使用名称和文件位置。但是当我在另一个PHP文件中打印r($\u POST)时,它只显示名称。有人知道如何补救吗 找到了。事实证明,我不仅需要打印($\u POST)来查看我提交的内容,还需要打印($\u文件)来查看我提交的文件。我做了一些修补,这就是我发现的。希望这对其他人有帮助。=) 使用打印文件($);要打印文件值,请这样编写
enctype=“多部分/表单数据”
mhmm.=)有点晚了,但谢谢你