模拟登陆

$webdb['cookie'] = '6o0xxdevwm16371195l2897615';
$webdb['datesite'] = 'http://66.133.87.55';
$webdb['user'] = 'qq1234';
$webdb['pawd'] = '123456';
$webdb['uid'] = '1';
 
$curl = new Curl_HTTP_Client();
$curl->store_cookies("tmp/cookies.txt"); 
$curl->set_user_agent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
$v=$webdb["datesite"];
$login=array();
$login['username']=$webdb["user"];
$login['passwd']=$webdb["pawd"];
$login['langx']="zh-cn";
$curl->set_referrer("".$v."");
$html_date=$curl->fetch_url("".$v."/app/member/","",5);
$html_date=$curl->send_post_data("".$v."/app/member/new_login.php",$login,"",5);
$new_uid=explode("|",$html_date);
//preg_match("/top.uid = '([^']+)/si",$html_date,$new_uid);
/*preg_match("/location.href = '([^']+)/si",$html_date,$turl);
$curl->set_referrer("".$v."/app/member/login.php");
$tdate=$curl->fetch_url($turl[1]);
preg_match("/action='([^']+)/si",$tdate,$wurl);
$v=$wurl[1];
 
if(!$v)$v=$webdb["datesite"];*/
//$v='http://hg3088.com';
if(strlen($new_uid[3])>0  ){
$uid=$new_uid[3];
$cache = "<?php\r\n";
$cache .= "\$webdb['cookie'] = '".$uid."';\r\n";
$cache .= "\$webdb['datesite'] = '".$v."';\r\n";
$cache .= "\$webdb['user'] = '".$webdb['user']."';\r\n";
$cache .= "\$webdb['pawd'] = '".$webdb['pawd']."';\r\n";
$cache .= "\$webdb['uid'] = '1';\r\n?>";
if(!write_file("db.php",$cache)){ //写入缓存失败
$meg = "缓存文件写入失败!请先设db.php文件权限为:0777";
}
 
write_file("../../../wap/zxcv567890/cj/db.php",$cache);
}
if($new_uid[3]){
echo '成功獲取繁體的uid: '.$uid.'<br>';
}else{
echo "繁體登陸錯誤!\\請檢查繁體用戶名和密碼!!<br><br>";
}
echo $webdb['user'].'<br />'.$v;
?>

转载于:https://www.cnblogs.com/csjoz/p/7243853.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值