+ -
当前位置:首页 → 问答吧 → 求高手解析 如何模拟登录这个网站

求高手解析 如何模拟登录这个网站

时间:2011-11-17

来源:互联网

这个是我们公司买的一个赤兔 
登录链接
http://kf.onlychitu.com/login.html


需要获取内容的链接
http://kf.onlychitu.com/quickview/trade.shtml
 源码如下
PHP code
$cookie_file    =    tempnam('./temp','cookie');
$username='';
$admin='';
$password='';
$login_url        =    'http://kf.onlychitu.com/login.html';
$post_fields    =    'j_username=$username&j_employeename=$admin&j_password=$password';

$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://kf.onlychitu.com/quickview/trade.shtml';
$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);
echo $contents;
curl_close($ch);



但是模拟登录不了 显示那个登录框求救 如何更改 谢谢

作者: tyde163   发布时间: 2011-11-17

http抓包看一下

作者: moocky   发布时间: 2011-11-17

相关阅读 更多