cURL help

Hello, I’m making a site similar to, 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, "");
    $useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: 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, "");
        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);
            echo $server_response ."\n";


Thanks in advance,

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