kunyashaw博客主页 关注kunyashaw新博客 关于kunyashaw 转到底部

24、php知识点总结基础教程--part-2

1、表单处理

 

①post请求

<html>
<body>

<form action="welcome.php" method="post">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit">
</form>

</body>
</html>

返回结果:

<html>
<body>

Welcome <?php echo $_POST["name"]; ?><br>
Your email address is: <?php echo $_POST["email"]; ?>

</body>
</html>

 

②get请求

<html>
<body>

<form action="welcome_get.php" method="get">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit">
</form>

</body>
</html>

 

<html>
<body>

Welcome <?php echo $_GET["name"]; ?><br>
Your email address is: <?php echo $_GET["email"]; ?>

</body>
</html>

 

2、表单验证

3、表单必填

4、表单URL/EMAL

5、表单完成

posted @ 2016-04-12 17:09  kunyashaw  阅读(197)  评论(0编辑  收藏  举报
回到顶部