关闭

php笔记(5) 数组GET

13420人阅读 评论(0) 收藏 举报
分类:
<?php
//	echo $_SERVER['argc'].'<br />';
//	echo $_SERVER['argv'].'<br />';
	if( $_SERVER['QUERY_STRING'] != '' )
	{
		echo 'QUERY_STRING '.$_SERVER['QUERY_STRING']. '<br />';
	}
	
	echo 'SERVER_ADDR ' .$_SERVER['SERVER_ADDR'].  '<br />';
	echo 'HTTP_ACCEPT ' .$_SERVER['HTTP_ACCEPT']. '<br />';
	echo 'HTTP_HOST   ' .$_SERVER['HTTP_HOST'].	'<br />';
	$allow_empty_referer = TRUE;
	if(isset($_SERVER['HTTP_REFERER']))
	{
		echo 'HTTP_REFERER '.$_SERVER['HTTP_REFERER'].	'<br />';
	}	
	if( $_SERVER['QUERY_STRING'] != '' )
	{
		if($_GET['user'] != '')
		{
			echo 'UserName:'.$_GET['user'].'<br />';
		}
		if($_GET['pwd'] != '')
		{
			echo 'PassWord:'.$_GET['pwd'].'<br />';
		}
	}	
?>
<html>
<body>
<form action="5.php" method="GET">
    Name:  <input type="text" name="user"><br />
    Pwd:  <input type="text" name="pwd"><br />
    <input type="submit" name="submit"/>
</form>
</body>
</html>


输入

SafeDebug QQ is

1322301722

运行显示:

QUERY_STRING user=safedebug+QQ+is&pwd=1322301722&submit=%CC%E1%BD%BB%B2%E9%D1%AF%C4%DA%C8%DD
SERVER_ADDR 192.168.145.130
HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*
HTTP_HOST 192.168.145.130
HTTP_REFERER http://192.168.145.130/5.php
UserName:safedebug QQ is
PassWord:1322301722


 

 

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:165209次
    • 积分:3738
    • 等级:
    • 排名:第8913名
    • 原创:222篇
    • 转载:0篇
    • 译文:0篇
    • 评论:10条
    资讯
    欢迎大家加入QQ交流群: 336836724 验证:博客csdn
    超级友情链接