osa
Новичок
Не работает curl под виндовым пхп
Доброго времени суток . . .
На локал хосте кукисы не работают .... на удаленке все ок
есть код
Доброго времени суток . . .
На локал хосте кукисы не работают .... на удаленке все ок
есть код
PHP:
$submit_vars = "";
$submit_vars .= "property_type=All types&";
$submit_vars .= "state=All states&";
$submit_vars .= "price=Any price&";
$submit_vars .= "Submit=Search";
$ch = curl_init();
$path = "http://www.compassweb.com/properties/index.html";
curl_setopt($ch, CURLOPT_URL,$path);
//curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch,CURLOPT_COOKIEJAR,'1.txt');
//curl_setopt($ch,CURLOPT_COOKIEFILE,'1.txt');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($ch);
curl_close($ch);
/* $file = fopen('-1.html','w');
fputs($file,$res);
fclose($file);*/
$ch = curl_init();
$path = "https://www.compassbank.com/appforms/properties/index.jsp";
curl_setopt($ch, CURLOPT_URL,$path);
//curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch, CURLOPT_COOKIESESSION, true);
//curl_setopt ($ch, CURLOPT_POSTFIELDS, $submit_vars);
curl_setopt($ch,CURLOPT_COOKIEFILE,'1.txt');
curl_setopt($ch,CURLOPT_COOKIEJAR,'1.txt');
//curl_setopt($ch,CURLOPT_COOKIEFILE,'1.txt');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($ch);
curl_close($ch);
/*$file = fopen('0.html','w');
fputs($file,$res);
fclose($file);*/
$ch = curl_init();
$path = "https://www.compassbank.com/appforms/properties/search_results.jsp";
curl_setopt($ch, CURLOPT_URL,$path);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $submit_vars);
curl_setopt ($ch, CURLOPT_COOKIESESSION, true);
//curl_setopt($ch,CURLOPT_COOKIEJAR,'1.txt');
curl_setopt($ch,CURLOPT_COOKIEFILE,'1.txt');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($ch);
curl_close($ch);