PHP利用超级全局变量$_GET来接收表单数据。

我们在linux上用 touch php_get.html php_get.php创建两个文件。

php_get.html文件的代码如下:

 1 <!doctype html>
 2 <html>
 3 <head>
 4 <title>超级全局变量$_GET来接收提交的数据,然后返回信息</title>
 5 <meta http-equiv="contnet-type" content="text/htm" charset="utf-8"/>
 6 </head>
 7 <body>
 8 <a style="font-weight:bold;color:red;" href="php_get.php?subject=主题&web=web内容">利用GET方式提交数据</a>
 9 </body>
10 </html>

访问php_get.html页面然后这个页面向php_get.php提交数据,php这个页面会返回信息。

php_get.php代码如下:

 1 <!dcotype html>
 2 <html>
 3 <head>
 4 <title>返回信息</title>
 5 <meta http-equiv="content-type" content="text/html" charset="utf-8"/>
 6 </head>
 7 <body>
 8 <?php
 9 echo "print:".$_GET['subject']."at".$_GET['web'];
10 ?>
11 </body>
12 </html>

 php_get.php这个页面将提交的数据$_GET接收并打印出去。

转载于:https://www.cnblogs.com/UncleFreak/p/5684210.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值