• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

CURL模拟登陆SINA微博有关问题

php 搞代码 4年前 (2022-01-23) 15次浏览 已收录 0个评论

CURL模拟登陆SINA微博问题

PHP code

<!---ecms Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?php$username =base64_encode("[email protected]"); $data = file_get_contents('http://login.sina.com.cn/sso/prelogin.php?entry=miniblog&callback=&user='.$username.'&client=ssologin.js(v1.3.16)');$json = json_decode($data);$pw = strtolower(sha1(strtolower(sha1(strtolower("111111"))).$json->servertime.$json->nonce));$CookieFile = '/sinacookie/'.$username.'_sinacookie.tmp';        $post_data = array(        "entry"=>"weibo",        "gateway"=>"1",        "from"=>"",        "savestate"=>"7",        "useticket"=>"1",        "ssosimplelogin"=>"1",        "username"=>$username, // base 64之后的用户名        "service"=>"miniblog",        "servertime"=>$json->servertime, //上步得到的服务器时间        "nonce"=>$json->nonce, //上步得到随机生成的字符串        "pwencode"=>"wsse",        "password"=>$pw, //加密的密码        "encoding"=>"utf-8",        "url"=>"+ HttpUtility.UrlEncode('http:'//'weibo.com/ajaxlogin.php?framelogin=1&callback=parent.sinaSSOController.feedBackUrlCal<mark>@本文来源gaodaimacom搞#代%码@网-</mark><strong>搞代gaodaima码</strong>lBack')",        "returntype"=>"META");         $ch = curl_init();curl_setopt($ch, CURLOPT_URL, "http://login.sina.com.cn/sso/login.php?client=ssologin.js(v1.3.16)");curl_setopt($ch, CURLOPT_POST, true);curl_setopt($ch, CURLOPT_POSTFIELDS,$post_data);curl_setopt($ch, CURLOPT_COOKIEJAR, $CookieFile);curl_setopt($ch, CURLOPT_COOKIEFILE, $CookieFile);curl_exec($ch);curl_close($ch);?>

请教怎么登陆不上去呢???用户名和密码都对呀,问题也没提示什么错

——解决方案——————–
http://www.gaodaima.com/article/29486.htm 看看这个


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:CURL模拟登陆SINA微博有关问题
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址