这个是我们公司买的一个赤兔
登录链接
http://kf.onlychitu.com/login.html
需要获取内容的链接
http://kf.onlychitu.com/quickview/trade.shtml
源码如下
$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);
但是模拟登录不了 显示那个登录框求救 如何更改 谢谢
登录链接
http://kf.onlychitu.com/login.html
需要获取内容的链接
http://kf.onlychitu.com/quickview/trade.shtml
源码如下
$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);
但是模拟登录不了 显示那个登录框求救 如何更改 谢谢
"j_username=$username&j_employeename=$admin&j_password=$password"
$cookie_file = tempnam('./temp','cookie');
$username='';
$admin='';
$password='';
$login_url = 'http://kf.onlychitu.com/logins.shtml';
$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);
$content = curl_exec($ch);
curl_close($ch);
echo $content;$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);小孩子还是难搞呀