11closed 0 Denunciar post Postado Março 20, 2015 olá pessoal, estou com um erro ao enviar a notificação... criei e ativei o App e estou testando no localhost e ONLINE tb, porem ambos esta com o msm erro o ERRO: Warning: curl_setopt() expects exactly 3 parameters, 5 given in C:\wamp\www\..........\teste.php on line 34 Codigo da teste.php <?php ini_set ('allow_url_fopen', '1'); $app_id = 'aq esta o ID do meu app'; $app_secret = 'aq esta o secret do app'; $user_id = 'aq esta o ID do facebook da pessoa que rescebera a notificaçao'; $token_url = "https://graph.facebook.com/oauth/access_token?client_id=".$app_id."&client_secret=".$app_secret."&grant_type=client_credentials"; $app_access_token = file_get_contents($token_url); $postdata = http_build_query( array( 'href' => 'index.php', 'template' => 'deu certoooo', 'ref' => 'ref' ) ); $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata) ); $context = stream_context_create($opts); //$result = file_get_contents('https://graph.facebook.com/'.$user_id.'/notifications?'.$app_access_token, false, $context); $curl_handle=curl_init(); curl_setopt($curl_handle, CURLOPT_URL,'https://graph.facebook.com/'.$user_id.'/notifications?'.$app_access_token, false, $context); curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_handle, CURLOPT_USERAGENT, 'name do app'); $query = curl_exec($curl_handle); curl_close($curl_handle); echo $curl_handle; ?> não esta enviando aqui... Compartilhar este post Link para o post Compartilhar em outros sites
ESerra 744 Denunciar post Postado Março 20, 2015 Basta ler o erro: curl_setopt() expects exactly 3 parameters, 5 given Ai são esperados 3 parâmetros, você está passando 5: curl_setopt($curl_handle, CURLOPT_URL,'https://graph.facebook.com/'.$user_id.'/notifications?'.$app_access_token, false, $context); Compartilhar este post Link para o post Compartilhar em outros sites