2013-01-16 107 views
0

我正在使用FB API和FQL來獲取識別用戶的某些事件代碼。獲取Facebook活動頁面

但是我想表明Facebook的活動頁面,但我不能找到這樣做的方式......

下面的例子:

I go to mywebsite.com, and I login into Facebook. 
I get a list of all my current events, with a Link 
If I follow this link, I get the event ID (1234567, for example) 
[this step is the one I want to do]: 
I show in my website (like if it was an iframe) the following FB page: 
    https://www.facebook.com/events/1234567 

所以,與我想允許用戶直接與Facebook交互,但不會離開我的網站...

我該怎麼做?可能嗎?

謝謝!

+0

不可能。 Facebook不允許您將他們的網站放入框架中。 – cpilko

回答

0

解決!

function viewFBActivity($id){ 
    $h = curl_init("https://www.facebook.com/events/".$id."/"); 
    curl_setopt($h, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); 
    curl_setopt($h, CURLOPT_HEADER, false); 
    curl_setopt($h, CURLOPT_HTTPHEADER, array("Accept-Language: es-es,en")); 
    curl_setopt($h, CURLOPT_SSL_VERIFYPEER, false); 
    curl_setopt($h, CURLOPT_SSL_VERIFYHOST, false); 
    curl_setopt($h, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); 
    curl_setopt($h, CURLOPT_RETURNTRANSFER, true); 
    curl_setopt($h, CURLOPT_AUTOREFERER, true); 
    $ret= curl_exec($h); 
    echo($ret); 
} 

我希望它可以幫助未來的人!