请各位高手帮忙看看, 为什么会出线 验证码 变化的情况? 该咋个修改啦<form id="form1" name="form1" method="post" action="__URL__/postGyyxDate" style="margin:0px">
请输入验证码:
<input type="text" name="gyyxSeccode" id="gyyxSeccode" value="" />
<input type="submit" name="sub" value="提交" style="float:left">
</form>
验证码:<img src="__URL__/getGyyxIntegralSecCode" />
function postGyyxDate(){
session_start();
if($_SERVER["REQUEST_METHOD"]=="POST")
{
$array=array(
'txtUserName'=>'test250',
'txtUserPassword'=>'test250',
'__VIEWSTATE'=>'/wEPDwUJNjA4OTE3MjQwD2QWAgIBD2QWAgIDDw8WAh4HVmlzaWJsZWhkZGRunW2iOaIX8JGlJMrE8QahY/NE7Q==','__EVENTVALIDATION'=>'/wEWBQKl9caCBgKl1bKzCQK9wKW7DAL+geuuCwKC3IeGDILX0crrtL6gOrkuj/AYCJ1hNrJv','txtCaptchaCode'=>trim($_POST["gyyxSeccode"]),
);
}
$login_Submit_url = 'http://account.gyyx.cn/Passport/EmbedLogin.aspx';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$login_Submit_url);
curl_setopt($ch,CURLOPT_COOKIEFILE,$_SESSION['gyyx_cookie_file']); curl_setopt($ch,CURLOPT_REFERER,"http://www.gyyx.cn");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $array);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HEADER, true);
$content = curl_exec($ch);
echo mb_convert_encoding($content, 'gb2312','utf-8'); curl_close($ch);
} function getGyyxIntegralSecCode(){
session_start();
$secCode_url = 'http://account.gyyx.cn/CaptchValidateCode.ashx';
$_SESSION['gyyx_cookie_file'] = tempnam('./temp','gyyx_cookie');
$ch = curl_init();
curl_setopt($ch,CURLOPT_REFERER,"http://www.gyyx.cn");
curl_setopt($ch, CURLOPT_URL,$secCode_url);//是要得到内容的地址
curl_setopt($ch,CURLOPT_RETURNTRANSFER,false);
curl_setopt($ch, CURLOPT_COOKIEJAR, $_SESSION['gyyx_cookie_file']);
if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'msie')===false)
{
header("content-type:image/jpg");
}
curl_exec($ch);
curl_close($ch);
}里面的用户名和账号都是有效的 ,请高手帮忙看看 应该怎么样修改代码 第一次 curl取回的 验证码
手动输入 post回去后 就变了 ,请各位高手指教下
请输入验证码:
<input type="text" name="gyyxSeccode" id="gyyxSeccode" value="" />
<input type="submit" name="sub" value="提交" style="float:left">
</form>
验证码:<img src="__URL__/getGyyxIntegralSecCode" />
function postGyyxDate(){
session_start();
if($_SERVER["REQUEST_METHOD"]=="POST")
{
$array=array(
'txtUserName'=>'test250',
'txtUserPassword'=>'test250',
'__VIEWSTATE'=>'/wEPDwUJNjA4OTE3MjQwD2QWAgIBD2QWAgIDDw8WAh4HVmlzaWJsZWhkZGRunW2iOaIX8JGlJMrE8QahY/NE7Q==','__EVENTVALIDATION'=>'/wEWBQKl9caCBgKl1bKzCQK9wKW7DAL+geuuCwKC3IeGDILX0crrtL6gOrkuj/AYCJ1hNrJv','txtCaptchaCode'=>trim($_POST["gyyxSeccode"]),
);
}
$login_Submit_url = 'http://account.gyyx.cn/Passport/EmbedLogin.aspx';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$login_Submit_url);
curl_setopt($ch,CURLOPT_COOKIEFILE,$_SESSION['gyyx_cookie_file']); curl_setopt($ch,CURLOPT_REFERER,"http://www.gyyx.cn");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $array);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HEADER, true);
$content = curl_exec($ch);
echo mb_convert_encoding($content, 'gb2312','utf-8'); curl_close($ch);
} function getGyyxIntegralSecCode(){
session_start();
$secCode_url = 'http://account.gyyx.cn/CaptchValidateCode.ashx';
$_SESSION['gyyx_cookie_file'] = tempnam('./temp','gyyx_cookie');
$ch = curl_init();
curl_setopt($ch,CURLOPT_REFERER,"http://www.gyyx.cn");
curl_setopt($ch, CURLOPT_URL,$secCode_url);//是要得到内容的地址
curl_setopt($ch,CURLOPT_RETURNTRANSFER,false);
curl_setopt($ch, CURLOPT_COOKIEJAR, $_SESSION['gyyx_cookie_file']);
if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']),'msie')===false)
{
header("content-type:image/jpg");
}
curl_exec($ch);
curl_close($ch);
}里面的用户名和账号都是有效的 ,请高手帮忙看看 应该怎么样修改代码 第一次 curl取回的 验证码
手动输入 post回去后 就变了 ,请各位高手指教下
curl_setopt($ch, CURLOPT_COOKIEJAR, $_SESSION['gyyx_cookie_file']);
curl_setopt($ch, CURLOPT_COOKIEFILE, $_SESSION['gyyx_cookie_file']);
...