TheLikePlanet Posted June 11, 2010 Share Posted June 11, 2010 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 //$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); ?> Thanks, TheLikePlanet Link to comment https://forums.phpfreaks.com/topic/204465-curl-help/ Share on other sites More sharing options...
xcandiottix Posted June 11, 2010 Share Posted June 11, 2010 Side note... make a hate one. I always think of things I hate that I'd love to share. Link to comment https://forums.phpfreaks.com/topic/204465-curl-help/#findComment-1070702 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.