Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Need help with php curl

taufikhdyttaufikhdyt Posts: 1Member
I need help to get flight schedule from http://www.sriwijayaair.co.id/id but always error using curl to access ssl.

here are my code:

<?php
$headers = array(
"User-Agent=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 GTB7.1 (.NET CLR 3.5.30729)",
"Accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Language=en-us,en;q=0.5",
"Accept-Encoding=gzip,deflate",
"Accept-Charset=ISO-8859-1,utf-8;q=0.7,*;q=0.7",
"Keep-Alive=1150",
"Connection=keep-alive",
"Referer=http://www.sriwijayaair.co.id/id",
"Cookie=language=in; location=id; dest=home; __utma=260465999.1394002812.1293106375.1293106375.1293106375.1; __utmb=260465999.1.10.1293106375; __utmc=260465999; __utmz=260465999.1293106375.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)",
"Content-Type=application/x-www-form-urlencoded",
"Content-Length=121",
"POSTDATA=isReturn=false&from=CGK&to=MES&departDate1=30-&departDate2=11-2010&adult=1&child=0&infant=0&returndaterange=0&Submit=Cari"
);

// do access to sriwijaya air
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "https://booking.sriwijayaair.co.id/b2c/AvailabilityServlet");
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_VERBOSE, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_COOKIEJAR, "cookie.txt");

//curl_setopt($curl, CURLOPT_POSTFIELDS, "isReturn=false&from=CGK&to=MES&departDate1=22&departDate2=01-2011&adult=1&child=0&infant=0&returndaterange=0&Submit=Cari");
$curlData = curl_exec($curl);


print_r($curlData);

curl_close($curl);
?>

any help will be appreciate, thanks
Sign In or Register to comment.