Php simulates logon to the QQ space, uses curl to help you see where the php simulates logon to the QQ space, and uses curl to help you see what went wrong, that is, you cannot directly obtain the page information after logon (including the personal homepage information after logon) & lt ;? Php $ qqname = ''; // enter the account $ qqpasswor php here to simulate logon to the QQ space. use the curl to help you see what went wrong.
Php simulates logon to the QQ space and uses the curl to help you see what is wrong, that is, you cannot directly obtain the information on the logon page (including the personal homepage information after logon)
$ Qqname = ''; // enter the account here
$ Qqpassword = ''; // enter the password here
If (! File_exists ('./temp ')){
Mkdir ('./temp ');
}
$ Cookie_file = tempnam ('./temp', 'cooker ');
$ Login_url = 'http: // ptlogin2.qq.com/login ';
$ Post_fields = 'U = '. $ qqname.' & m = '. $ qqpassword.' & css = http://imgcache.qq.com/ptcss/b2/qzone/15000101/style.css&mibao_css=m_qzone&aid=15000101&u1=http://imgcache.qq.com/qzone/v5/loginsucc.html? Para = izone & ptredirect = 1 & h = 1 & from_ui = 1 & dumy = ';
$ Ch = curl_init ($ login_url );
Curl_setopt ($ ch, CURLOPT_HEADER, 0 );
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 );
Curl_setopt ($ ch, CURLOPT_POST, 1 );
Curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ post_fields );
Curl_setopt ($ ch, CURLOPT_COOKIEJAR, $ cookie_file );
Curl_exec ($ ch );
Curl_close ($ ch );
$ Url = 'http: // imgcache.qq.com/qzone/v5/loginsucc.html? Para = izone ';
$ Ch = curl_init ($ url );
Curl_setopt ($ ch, CURLOPT_HEADER, 0 );
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 );
Curl_setopt ($ ch, CURLOPT_COOKIEFILE, $ cookie_file );
Curl_exec ($ ch );
// Preg_match ("/
(. *) <\/Li>/", $ contents, $ arr );
Curl_close ($ ch );
$ Url = 'http: // user.qzone.qq.com/'.w.qqname;
$ Ch = curl_init ($ url );
Curl_setopt ($ ch, CURLOPT_HEADER, 0 );
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 );
Curl_setopt ($ ch, CURLOPT_COOKIEFILE, $ cookie_file );
$ Contents = curl_exec ($ ch );
// Preg_match ("/(. *) <\/Li>/", $ contents, $ arr );
Echo $ contents;
Curl_close ($ ch );
?>
------ Solution --------------------
Debug