Heim > Backend-Entwicklung > PHP-Tutorial > php模拟登录qq空间,用的curl,帮忙看下哪里错了

php模拟登录qq空间,用的curl,帮忙看下哪里错了

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Freigeben: 2016-06-23 13:35:57
Original
991 Leute haben es durchsucht

php模拟登录qq空间,用的curl,帮忙看下哪里错了,就是不能直接获取登录后的页面信息(包括登陆后的个人主页信息等)

<?php$qqname='';//这里填写帐号$qqpassword='';//这里填写密码if(!file_exists('./temp')){	mkdir('./temp');	}$cookie_file    =    tempnam('./temp','cookie');$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>  (.*)<\/li>/",$contents,$arr);curl_close($ch);$url='http://user.qzone.qq.com/'.$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>  (.*)<\/li>/",$contents,$arr);echo $contents;curl_close($ch);?>
Nach dem Login kopieren


回复讨论(解决方案)

有没有知道的??

调试一下,看提示什么错误才好解决呀

有没有知道的??

加个followlocation看看

调试下

QQ相关页面的登陆是get形式的,不是post,所有提交的信息都是通过get方式提交的,但需要注意其登录密码是经过加密处理为32位密文的

QQ相关页面的登陆是get形式的,不是post,所有提交的信息都是通过get方式提交的,但需要注意其登录密码是经过加密处理为32位密文的



有木有什么参考文档类的?
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage