wmaraci reklam

allow_url_fopen yerine cUrl Kullanmak

16 Mesajlar 2.723 Okunma
wmaraci reklam

CenkOnsoy CenkOnsoy Skype: cenkonsoy Kullanıcı
  • Üyelik 18.10.2012
  • Yaş/Cinsiyet 37 / E
  • Meslek Uzman Biyolog
  • Konum Ankara
  • Ad Soyad C** Ö**
  • Mesajlar 4042
  • Beğeniler 77 / 1356
  • Ticaret 37, (%100)
Bu allow_url_fopen komutu birçok hazır script ve kurulumda canımı sıkıyor, bir kere adam gibi toparlayabilsem gerçekten keyif alıcam, hızlı da olucak ama yok, oluyor.

Bu sefer de facebook login içerisinde aynı sıkıntıyı yaşıyorum.


$my_url = $config['baseurl']."/";
$token_url = "https://graph.facebook.com/oauth/access_token?"
. "client_id=" . $A . "&redirect_uri=" . urlencode($my_url)
. "&client_secret=" . $B . "&code=" . $code;
$response = @file_get_contents($token_url);
$params = null;
parse_str($response, $params);
$graph_url = "https://graph.facebook.com/me?access_token="
. $params['access_token'];
$user = json_decode(file_get_contents($graph_url));
$fname = htmlentities(strip_tags($user->name), ENT_COMPAT, "UTF-8");
$femail = htmlentities(strip_tags($user->email), ENT_COMPAT, "UTF-8");
//pics
$fbpid = htmlentities(strip_tags($user->id), ENT_COMPAT, "UTF-8");
$fbpicurl = "http://graph.facebook.com/".$fbpid."/picture";
$fbpicurl2 = "http://graph.facebook.com/".$fbpid."/picture?type=large";


iki noktada file_get_contents canımı sıkıyor. Bu kodları curl'e çevirirseniz felaket mutlu olacağım.. bütün günümü buna harcadım resmen, üstüne host ile tartıştım, sonuç sıfır.
 

 

Bilim Forum | Bilimgunlugu.com
wmaraci
reklam

Cafer Cafer Üyeliği Durdurulmuş Banlı Kullanıcı
  • Üyelik 22.02.2012
  • Yaş/Cinsiyet 29 / E
  • Meslek PHP Developper
  • Konum İstanbul Avrupa
  • Ad Soyad ** **
  • Mesajlar 250
  • Beğeniler 65 / 71
  • Ticaret 2, (%100)
function getir($url)
{
$ch = curl_init();
$timeout = 10;
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_HEADER,false);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$my_url = $config['baseurl']."/";
$token_url = "https://graph.facebook.com/oauth/access_token?"
. "client_id=" . $A . "&redirect_uri=" . urlencode($my_url)
. "&client_secret=" . $B . "&code=" . $code;
$response = getir($token_url);
$params = null;
parse_str($response, $params);
$graph_url = "https://graph.facebook.com/me?access_token="
. $params['access_token'];
$user = json_decode(file_get_contents($graph_url));
$fname = htmlentities(strip_tags($user->name), ENT_COMPAT, "UTF-8");
$femail = htmlentities(strip_tags($user->email), ENT_COMPAT, "UTF-8");
//pics
$fbpid = htmlentities(strip_tags($user->id), ENT_COMPAT, "UTF-8");
$fbpicurl = "http://graph.facebook.com/".$fbpid."/picture";
$fbpicurl2 = "http://graph.facebook.com/".$fbpid."/picture?type=large";
 

 

CenkOnsoy CenkOnsoy Skype: cenkonsoy Kullanıcı
  • Üyelik 18.10.2012
  • Yaş/Cinsiyet 37 / E
  • Meslek Uzman Biyolog
  • Konum Ankara
  • Ad Soyad C** Ö**
  • Mesajlar 4042
  • Beğeniler 77 / 1356
  • Ticaret 37, (%100)
Hocam yardım çalışmanızdan ötürü minnettarım, lakin
$user = json_decode(file_get_contents($graph_url)); ile hala fopen kullanılıyor, bu yüzden kodlama işe yaramadı henüz.
 

 

Bilim Forum | Bilimgunlugu.com

Cafer Cafer Üyeliği Durdurulmuş Banlı Kullanıcı
  • Üyelik 22.02.2012
  • Yaş/Cinsiyet 29 / E
  • Meslek PHP Developper
  • Konum İstanbul Avrupa
  • Ad Soyad ** **
  • Mesajlar 250
  • Beğeniler 65 / 71
  • Ticaret 2, (%100)

CenkOnsoy adlı üyeden alıntı

Hocam yardım çalışmanızdan ötürü minnettarım, lakin
$user = json_decode(file_get_contents($graph_url)); ile hala fopen kullanılıyor, bu yüzden kodlama işe yaramadı henüz.


$user = json_decode(getir($graph_url));
CenkOnsoy

kişi bu mesajı beğendi.

wmaraci
wmaraci

CenkOnsoy CenkOnsoy Skype: cenkonsoy Kullanıcı
  • Üyelik 18.10.2012
  • Yaş/Cinsiyet 37 / E
  • Meslek Uzman Biyolog
  • Konum Ankara
  • Ad Soyad C** Ö**
  • Mesajlar 4042
  • Beğeniler 77 / 1356
  • Ticaret 37, (%100)
Hocam inanılmaz teşekkür ederim size, internette o kadar ingilizce forum gezdim konuyu anlamak, algılayabilmek için.. Minnettarım. Gayet güzel çalıştı. Elinize sağlık.
 

 

Bilim Forum | Bilimgunlugu.com

Cafer Cafer Üyeliği Durdurulmuş Banlı Kullanıcı
  • Üyelik 22.02.2012
  • Yaş/Cinsiyet 29 / E
  • Meslek PHP Developper
  • Konum İstanbul Avrupa
  • Ad Soyad ** **
  • Mesajlar 250
  • Beğeniler 65 / 71
  • Ticaret 2, (%100)
Rica ederim üstad. Hayırlı geceler
 

 

wmaraci
Konuyu toplam 1 kişi okuyor. (0 kullanıcı ve 1 misafir)
Site Ayarları
  • Tema Seçeneği
  • Site Sesleri
  • Bildirimler
  • Özel Mesaj Al