Curl Cookiejar does not get the content
Curlimage ();
function Curlimage () {
$cookieJar =tempnam (' tmp ', cookieimage);
$ch =curl_init ("http://124.160.104.166/(1jovmraaf1pemj55dkr01ebo)/checkcode.aspx");
curl_setopt ($ch, Curlopt_cookiejar, $cookieJar);
curl_setopt ($ch, Curlopt_returntransfer, 1);
$image =curl_exec ($ch);
Curl_close ($ch);
$FP =fopen ("Image.gif", "w+");
Fwrite ($fp, $image);
}
This code is to obtain a verification code plus a cookie, but every time you look at the Cookieimage file is empty
Why is this? [yabao=] [/yabao] [yabao=] [/yabao]
------to solve the idea----------------------
Print_r (get_headers (' http://124.160.104.166/'));
array
(
[0] = http/1.1 302 Found
[1] = = Connection:close
[2] => ; Date:thu, 03:05:03 GMT
[3] = server:microsoft-iis/6.0
[4] = = X-powered-by:asp.net
[5] = = x-aspnet-version:1.1.4322
[6] = Location:/(MGGXRGVMYM2TZN45B5WFKH55)/default2.aspx
[7] =& Gt Cache-control:private
[8] = content-type:text/html; charset=gb2312
[9] = = content-length:158
[Ten] = http/1.1-OK
[one] = Connection:close
[] = Date:thu, the Oct 03:05:04 GMT
[+] = server:microsoft-iis/6.0
[+] = X-powered-by:asp.net
[] = x-aspnet-version:1.1.4 322
[+] = Pragma:no-cache
[+] = Cache-control:no-cache
[] = Pragma:no-cache
[+] = Expires:-1
[] = content-type:text/html; charset=gb2312
[+] = content-length:4091)
It is obvious that the path of the form (mggxrgvmym2tzn45b5wfkh55) in the jump is the role of the session.
------to solve the idea----------------------
That's right on the top.