Home > Backend Development > PHP Tutorial > PHP接收post请求并存入文件

PHP接收post请求并存入文件

WBOY
Release: 2016-06-20 12:53:50
Original
2701 people have browsed it

提交post页面:

<!DOCTYPE html><html><head></head><body><form action="upload.php" method="post">	<input type="text" name="name">	<input type="submit"></form></body></html>
Copy after login

接收post页面:

<?phpvar_dump($_POST);//post 是数组,不能用echoreturn;$filename = $_POST['name'];if ($filename) {	file_put_contents("9.txt",$filename);}echo  $filename;?>
Copy after login


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template