Tolong pilih kategori sesuai, jenis posting (diskusi atau bukan) dan sertakan tag/topik yang sesuai seperti komputer, java, php, mysql, dll. Promosi atau posting tidak pada tempatnya akan kami hapus!
- Bagi Anda yang ingin mendaftar, baca link berikut:
http://diskusiweb.com/discussion/50491/how-to-registrasi-diskusiweb-com-baca-ini-terlebih-dahulu
- Cara menyisipkan kode program supaya tampil rapi dan terformat dengan baik di diskusiweb.com: http://www.diskusiweb.com/discussion/50415/cara-menyisipkan-kode-program-di-diskusiweb-com
- Cara posting gambar/image di post Anda: http://www.diskusiweb.com/discussion/47345/cara-menyisipkan-menyertakan-image-pada-posting/p1

BANTUIN DONG...

Gan, ane mau scraping jadwal penerbangan lion air pake php curl, tapi kok gak jalan ya, dimana letak kesalahannya...

ini script saya :

<?php

$postfield ="trip_type=one%20way&date_flexibility=fixed&depart=SUB&dest.1=BDJ&date.0=18AUG&date.1=18AUG&persons.0=1&persons.1=0&persons.2=0&origin=EN&usercountry=ID";
$postfield .= "&__EVENTTARGET=";
$postfield .= "&__EVENTARGUMENT=";
$postfield .= "&__LASTFOCUS=";
$postfield .= "&__VIEWSTATE=/wEPDwUKMTU5NDcwODE5OA9kFgJmD2QWAgIBD2QWAgIBD2QWAgIBDxQrAAsQZBAVChEtIFBsZWFzZSBTZWxlY3QgLQdFbmdsaXNoEEJhaGFzYSBJbmRvbmVzaWEHRW5nbGlzaBJTaW1wbGlmaWVkIENoaW5lc2UHRW5nbGlzaBJTaW1wbGlmaWVkIENoaW5lc2UHRW5nbGlzaApWaWV0bmFtZXNlBkFyYWJpYxUKES0gUGxlYXNlIFNlbGVjdCAtBWVuLVRUAmlkAmVuBXpoLVNHBWVuLVpBBXpoLUNOBWVuLUJaAnZpBWFyLVNBFCsDCmdnZ2dnZ2dnZ2cWAQICZBQrAAQFFWV4dGVuZGVkX0dyb3VwaW5nVHlwZQUDTmV3BRVleHRlbmRlZF9Hcm91cGluZ1RleHQFCUluZG9uZXNpYRQrAAQFFWV4dGVuZGVkX0dyb3VwaW5nVHlwZQUHSW5oZXJpdAUVZXh0ZW5kZWRfR3JvdXBpbmdUZXh0BQlJbmRvbmVzaWEUKwAEBRVleHRlbmRlZF9Hcm91cGluZ1R5cGUFA05ldwUVZXh0ZW5kZWRfR3JvdXBpbmdUZXh0BQlTaW5nYXBvcmUUKwAEBRVleHRlbmRlZF9Hcm91cGluZ1R5cGUFB0luaGVyaXQFFWV4dGVuZGVkX0dyb3VwaW5nVGV4dAUJU2luZ2Fwb3JlFCsABAUVZXh0ZW5kZWRfR3JvdXBpbmdUeXBlBQNOZXcFFWV4dGVuZGVkX0dyb3VwaW5nVGV4dAUITWFsYXlzaWEUKwAEBRVleHRlbmRlZF9Hcm91cGluZ1R5cGUFB0luaGVyaXQFFWV4dGVuZGVkX0dyb3VwaW5nVGV4dAUITWFsYXlzaWEUKwAEBRVleHRlbmRlZF9Hcm91cGluZ1R5cGUFA05ldwUVZXh0ZW5kZWRfR3JvdXBpbmdUZXh0BQdWaWV0bmFtFCsABAUVZXh0ZW5kZWRfR3JvdXBpbmdUeXBlBQdJbmhlcml0BRVleHRlbmRlZF9Hcm91cGluZ1RleHQFB1ZpZXRuYW0UKwAEBRVleHRlbmRlZF9Hcm91cGluZ1R5cGUFA05ldwUVZXh0ZW5kZWRfR3JvdXBpbmdUZXh0BQxTYXVkaSBBcmFiaWFkZH3bVLx4vhPzid99k8jDqLC1S5Tg";
$agent="Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20100101 Firefox/14.0.1"; 
 
$ch=curl_init(); 


curl_setopt ($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfield);
curl_setopt($ch, CURLOPT_ENCODING, "");
curl_setopt($ch,CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER,0);
curl_setopt($ch,CURLOPT_REFERER, $reffer); 
 
curl_setopt ($ch, CURLOPT_URL, $url);
$result=curl_exec($ch);
curl_close($ch);
echo $result;

?>
Sign In or Register to comment.