首页 > 代码库 > php -- 表单

php -- 表单

----- 010-form.html -----

 1 <!DOCTYPE html>
 2 <html>
 3 <head>
 4     <meta http-equiv="content-type" content="text/html; charset=utf-8">
 5     <title>一个PHP网页</title>
 6 </head>
 7 <body>
 8 <center>
 9     <form action="010-get.php">
10         用户名:<input type="text" name="username"/><br/>
11         密&nbsp;&nbsp;码:<input type="text" name="password"/><br/>
12         <input type="submit" name="submit" value="http://www.mamicode.com/登录"/>
13         <input type="reset" name="reset" value="http://www.mamicode.com/重置"/>
14     </form>
15 </center>
16 </body>
17 </html>

----- 010-get.php -----

 1 <!DOCTYPE html>
 2 <html>
 3 <head>
 4     <meta http-equiv="content-type" content="text/html; charset=utf-8">
 5     <title>一个PHP网页</title>
 6 </head>
 7 <body>
 8 <?php
 9     echo "用户名:", $_GET[‘username‘], "<br/>";
10     echo "密码:", $_GET[‘password‘], "<br>";
11 ?>
12 </body>
13 </html>