Use Facebook to get user information
$graph _url= "Https://graph.facebook.com/me?scope=email&fields=id,name,email,first_name,last_name,link, birthday,picture&access_token= $access _token "; $s = Curl_init (); curl_setopt ($s, curlopt_url, $url); curl_setopt ($ s,curlopt_returntransfer,1); curl_setopt ($s, curlopt_header, 0); $body = curl_exec ($s); curl_close ($s);
$body, always empty, but Var_dump (Curl_errno ($s)); no error number.
and directly to the $graph_url, put in the browser address bar, is able to obtain information
Went online to check the next, plus curl_setopt ($s, curlopt_ssl_verifypeer, 0);
CURLOPT_SSL_VERIFYHOST
The value
- Set to
0
indicate that the certificate is not checked
- Set to
1
indicate whether a field is checked in the certificate CN(common name)
- Set to
2
represent the 1
basis of the colonel's inspection当前的域名是否与CN匹配
libcurl
the previous version of this variable is the boolean
value, for the true
time effect is set to 2
, and later out 调试需求
, increased 仅校验是否有CN字段
options, so two values are true/false
not enough, upgrade to 0/1/2
three values.
Later (later libcurl_7.28.1
versions), this debug option is removed because of this, so it is 经常被开发者用错
not supported at this 1
time, there are only 0/2
two kinds of values.
Facebook uses curl to get user profiles