Fsockopen cannot get web page correctly, return 403 error
PHP's Fsockopen function can fetch other pages normally, but gets http://check.ptlogin2.qq.com/check?regmaster=&uin=369872340&appid= 549000912&js_ver=10049&js_type=1&login_sig= 4anczek7pq2h04jl8ns0xfdqpqsj-of5czyfk1loay47-hswqg3rmelscz6qiayo&u1=http%3a%2f%2fqzs.qq.com%2fqzone%2fv5% 2floginsucc.html%3fpara%3dizone&r=0.42962526359176423
is a 403 error.
Server is assumed in this machine, this function normal access to the page, can be seen to exclude the site is blocked by the IP. Suspicion is Fsockopen's problem.
Would like to ask the experts can use the Fsockopen function to obtain the page correctly, look more enlighten Ah!
Share to: more
------Solution--------------------
Again AppID and Login_sig ... There's no way we can test you, unless someone has done it before and it works.
------Solution--------------------
Direct browser Access,
PTUI_CHECKVC (' 0 ', '! YZG ', ' \x00\x00\x00\x00\x16\x0b\xcd\xd4 ');
is obviously a JSONP application
echo file_get_contents (' http://check.ptlogin2.qq.com/check?regmaster=&uin=369872340&appid=549000912 &js_ver=10049&js_type=1&login_sig=4anczek7pq2h04jl8ns0xfdqpqsj-of5czyfk1loay47-hswqg3rmelscz6qiayo &u1=http%3a%2f%2fqzs.qq.com%2fqzone%2fv5%2floginsucc.html%3fpara%3dizone&r=0.42962526359176423 ');
Have
PTUI_CHECKVC (' 1 ', ' ft8rvzgwagpfnzhulxg9loxegxgkseuv ', ' \x00\x00\x00\x00\x16\x0b\xcd\xd4 ');
....
------Solution--------------------
$host = ' check.ptlogin2.qq.com ';
$param = '/check?regmaster=&uin=369872340&appid=549000912&js_ver=10049&js_type=1&login_ Sig=4anczek7pq2h04jl8ns0xfdqpqsj-of5czyfk1loay47-hswqg3rmelscz6qiayo&u1=http%3a%2f%2fqzs.qq.com%2fqzone% 2fv5%2floginsucc.html%3fpara%3dizone&r=0.42962526359176423 ';
$out = Array (
"GET $param http/1.0",
"Host: $host",
' connection:close ',
', ' '
');
$fp = Fsockopen ($host, $errer, $errno, 1);
Fwrite ($fp, join ("\ r \ n", $out));
while (! feof ($fp)) {
echo fread ($fp, 1024x768);
}
http/1.1 OK
Server:tencent HTTP Server
Pragma:no-cache
p3p:cp= "CAO PSA our"
set-cookie:confirmuin=0; path=/; domain=ptlogin2.qq.com;
set-cookie:ptvfsession= EC74C1FDAB7C67A28E60E26B39CA2CD789648DF0341F311EBD4A970791B4E4AF72576FEB6FC4ABF6E403D3A52FF4CCD5; path=/; domain=ptlogin2.qq.com;
SET-COOKIE:PTISP=CTC; path=/; domain=qq.com;
Connection:close
Content-type:application/x-javascript; Charset=utf-8
PTUI_CHECKVC (' 0 ', '! Wkv ', ' \x00\x00\x00\x00\x16\x0b\xcd\xd4 ');
------Solution--------------------
Options FollowSymLinks
AllowOverride None
Order Deny,allow
Deny from all
How do you configure this thing?