cURL help

Hello, I’m making a site similar to http://thelikeportal.com, and I need a little help. I’m using cURL to do this, but I’m running into a problem. When you create a page on facebook, 2 random strings are generated (post_form_id, and fb_dtsg). I don’t know how to get these 2 strings from facebook. Here’s what I currently have:
[php] <?php

 //$like = $_POST['like'];
 //$dashed_like = str_replace(" ", "-", $like);
 //$desc = $_POST['desc'];
 $ckfile = tmpfile();    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "http://www.facebook.com/pages/create.php");
    $useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3";
    curl_setopt($ch, CURLOPT_USERAGENT, $useragent);                                                      
            curl_setopt ($ch, CURLOPT_COOKIEJAR, $ckfile);                                                
        curl_setopt ($ch, CURLOPT_POST, 1);                                                               
            curl_setopt ($ch, CURLOPT_REFERER, "http://www.facebook.com/pages/create.php");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_POSTFIELDS, "post_form_id=". $post_form_id ."&fb_dtsg=". $fb_dtsg ."&is_community=1&page_name=". $page_name ."");
                      $server_response = curl_exec($ch);
            parse_str($server_response);
            echo $server_response ."\n";
            sleep(9999);
            
            
            ?>

[/php]

Thanks in advance,
TheLikePlanet

You need to somehow check response to extract these two variables, before you’re using them in your query to facebook api. Looks like some command is missing. Did you check their API guide?

Sponsor our Newsletter | Privacy Policy | Terms of Service