当前位置:Gxlcms > PHP教程 > phpget数据有关问题请问

phpget数据有关问题请问

时间:2021-07-01 10:21:17 帮助过:16人阅读

php get数据问题请教
PC客户端通过crul post数据至后台:
http://218.204.14.50/test/?oldip=61.141.251.21&newip=61.141.251.25&urldata=http://detail.ju.taobao.com/home.htm?spm=601#/&agent=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E) &normal=100&error=102

后台PHP获取数据代码:
$oldip=$_GET["oldip"];
$newip=$_GET["newip"];
$urldata=$_GET["urldata"];
$agent=$_GET["agent"];
$normal=$_GET["normal"];
$error=$_GET["error"];
file_put_contents(test.txt,$oldip,FILE_APPEND);
file_put_contents(test.txt,$newip,FILE_APPEND);
file_put_contents(test.txt,$urldata,FILE_APPEND);
file_put_contents(test.txt,$agent,FILE_APPEND);
file_put_contents(test.txt,$normal,FILE_APPEND);
file_put_contents(test.txt,$error,FILE_APPEND);
?>

后台只能获取到oldip、newip、urldata数据,获取不到agent、normal、error数据,请问高手可能是什么原因?如何解决?
非常感谢!
------解决思路----------------------
引用:
urlencode之后还是获取不到agent、normal、error数据,但将urldata值置为test之后,就可以收到数据了,怀疑是不是$_GET长度有限制,如果不用$_GET、$_REQUEST,还有其它解决方案吗?谢谢!


$_GET有2k的限制,改用POST就好了。
------解决思路----------------------

file_put_contents('test.txt', print_r($_POST,1));
贴出 test.txt 的内容

人气教程排行