PHP 学习笔记——接受表单数据。

来源:互联网 发布:数控机床加工编程 编辑:程序博客网 时间:2024/05/29 18:11

1,form.php文件内容如下:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>Insert title here</title>
</head>

<body>
 <form action="Demo2.php" method="post">
  <input type="text" name="username" />
  <input type="submit" value="提交"/>
 </form>
</body>
</html>

 

2接受表单数据的Demo2.php内容如下:

<?php

 $username=$_POST["username"];
 echo $username;

?>