cURL help needed

Discussion in 'PHP' started by crazyryan, Aug 1, 2008.

  1. #1
    fixedfixed
     
    crazyryan, Aug 1, 2008 IP
  2. CarcaBot

    CarcaBot Active Member

    Messages:
    389
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #2
    try something simple
    
    $file_get_contents = "your url";
    
    PHP:
    and use this function to get what you need.

    
    function carcabot ($string, $source1, $source2) {
        $mid_url = "";
        $pos_s = strpos($string,$source1);
        $pos_e = strpos($string,$ssource2);
        for ( $i=$pos_s+strlen($source1) ; ( ( $i < ($pos_e)) && $i < strlen($string) ) ; $i++ ) {
            $mid_url .= $string[$i];
        }
        return $mid_url;
    }
    
    PHP:

    /CarcaBot
     
    CarcaBot, Aug 1, 2008 IP
  3. crazyryan

    crazyryan Well-Known Member

    Messages:
    3,087
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    175
    #3
    fixedfixed
     
    crazyryan, Aug 1, 2008 IP
  4. juust

    juust Peon

    Messages:
    214
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    $ua='Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5';
    curl_setopt($ch, CURLOPT_USERAGENT, $ua);
    something like that ?
     
    juust, Aug 1, 2008 IP
  5. crazyryan

    crazyryan Well-Known Member

    Messages:
    3,087
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    175
    #5
    fixedfixed
     
    crazyryan, Aug 1, 2008 IP
  6. crazyryan

    crazyryan Well-Known Member

    Messages:
    3,087
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    175
    #6
    fixedfixed
     
    crazyryan, Aug 1, 2008 IP