PHP CURL Pengambil data bank

Discussion in 'Desain Web dan Programming' started by Mylo Sepz, 29 Oct 2013.

Thread Status:
Not open for further replies.
  1. Mylo Sepz

    Mylo Sepz Apprentice 2.0

    Messages:
    532
    Likes Received:
    59
    Trophy Points:
    28
  2. xphones

    xphones Expert 1.0

    Messages:
    745
    Likes Received:
    41
    Trophy Points:
    28
    Curl itu kan kira2 seperti ini;

    Code:
    <?php
    
    $url = "http://situs atau url target";
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    
    curl_exec($ch);
    
    ?>
    
     
  3. localhost

    localhost Apprentice 2.0

    Messages:
    576
    Likes Received:
    39
    Trophy Points:
    28
    Data apa yang akan diambil ? apakah protokolnya http atau https ? dan perlu authentikasi atau tidak ? itu semua bisa dikustom via curl_setopt
     
  4. Mylo Sepz

    Mylo Sepz Apprentice 2.0

    Messages:
    532
    Likes Received:
    59
    Trophy Points:
    28
    Nah kalo untuk CURL 1 URL saya mengerti tetapti untuk mengambil data bank misalkan history transaksi kan perlu "Login" terlebih dahulu lalu ke menu "History"

    Untuk CURLnya 2 url mas jadi kita "login" dahulu lalu baru ambil data bank misalkan "history" transaksi di url yang berbeda tetapi masih 1 web
     
  5. wahanahosting

    wahanahosting Beginner 1.0

    Messages:
    24
    Likes Received:
    4
    Trophy Points:
    3
    tuh dah tau stepnya harus pake 2 kali CURL. tinggal bikin code nya untuk 2 kali CURL tsb.
    CURL pertama pake POST untuk login, kalo CURL yg ke-dua pake GET untuk dapatkan data history.

    coba baca2 disini http://coderscult.com/tag/curl/
     
    Mylo Sepz likes this.
  6. Mylo Sepz

    Mylo Sepz Apprentice 2.0

    Messages:
    532
    Likes Received:
    59
    Trophy Points:
    28
    Makasih banyak Tuan udah work :)
     
Loading...
Thread Status:
Not open for further replies.

Share This Page

Loading...