Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* STEP 1. let’s create a cookie file */
- $ckfile = tempnam ("tmp", "CURLCOOKIE");
- /* STEP 2. visit the homepage to set the cookie properly */
- $ch = curl_init ("http://www.batavia-air.com/");
- curl_setopt ($ch, CURLOPT_COOKIEJAR, $ckfile);
- curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
- $output = curl_exec ($ch);
- /* STEP 3. visit cookiepage.php */
- $ch = curl_init ("http://www.batavia-air.com/public/etiket/includes/class/booking/template/cariBookAjaxPros2.php");
- curl_setopt ($ch, CURLOPT_COOKIEFILE, $ckfile);
- curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
- $output = curl_exec ($ch);
- /* here you can do whatever you want with $output */
- $datatopost = array (
- "ajax_type" => "non_ajax",
- "blnthnBerangkatPergi" => "12/12",
- "jmlInfant" => "0",
- "jmlPenumpang" => "1",
- "kalenderPergi" => "",
- "page" => "booking",
- "page" => "booking",
- "radio" => "flight",
- "ruteBerangkat" => "CGK",
- "ruteKembali" => "kembali",
- "ruteTujuan" => "AMQ",
- "tglBerangkatPergi" => "22",
- );
- $ch = curl_init ($output);
- curl_setopt ($ch, CURLOPT_POST, true);
- curl_setopt ($ch, CURLOPT_POSTFIELDS, $datatopost);
- curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
- $returndata = curl_exec ($ch);
- echo $returndata;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement