<?php
/*超全局数组:$_GET $_POST $_REQUEST
1.使用$_GET来接收用户通过URL向服务器传的参数;get
缺点:用户的相关信息如账号密码等会在地址栏中明文显示,且地址栏传参有长度限制;
2.使用$_POST来接收用户通过http协议向服务器传的参数:post
3.$_REQUEST:可以接受任何从客户端向服务器传的参数,功能太过强大所以一般不会选择使用;
4.在demo.php中使用print_r($_GET)或者print_r($_POST)来接收参数并打印出来;
*/
echo "<a href='demo.php?aa==11&bb==22'> 测试页面 </a>";
echo "<form action='demo.php?a=男&c=23' method='post'><br>";
echo "username1:<input type='text' name='name1'><br>";
echo "username2:<input type='text' name='name2'><br>";
echo "username3:<input type='text' name='name3'><br>";
echo "sex:<input type='text' name='sex'><br>";
echo "age:<input type='text' name='age'><br>";
echo "<input type='submit' value='提交'>";
echo "</form>";
?>
原文链接:https://blog.csdn.net/living_ren/article/details/73699515
本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。
还没有人抢沙发呢~