curl - get content from facebook url using php -


how content facebook url , extract facebook user id , access token. have used curl , it's returning empty content.

            $url = 'https://graph.facebook.com/oauth/access_token?client_id='.$fbconfig['appid'].'&redirect_uri='.$returnurl.'&client_secret='.$fbconfig['secret'].'&code='.$_request['code'];     $ch = curl_init();     curl_setopt_array($ch, array(         curlopt_url => $url,         curlopt_returntransfer => true,         curlopt_ssl_verifypeer => false,         curlopt_verbose => true         ));     $result = curl_exec($ch);     curl_close($ch);        $iresult=alowuseraccess();   $fbuserid = explode('|', $iresult); $fbuserid = explode('|', $fbuserid['1']); $fbuserid = explode('-', $fbuserid['0']);  $iuserid = $fbuserid['1'];  $iuserid = $iresult; $saccesstoken = explode('access_token=', $iresult); 

try using options used here:

php script automate login , form submit

your not setting both ssl opts, possible may want set cookie.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -