看板 Web_Design 關於我們 聯絡資訊
我現在想要做使用FB來登入我的網站, 並取得FB照面、姓名即可 使用JSP,使用server side來做access token 目前可以取得Permission和連到 access Token的網址 當我看到facebook的範例中,看到php 的 file_get_contents就不會用了 請問有人用jsp寫過嗎? 到這邊的話使用jsp要如何取得使用者資訊呢? 以下是官網的php範例 $response = file_get_contents($token_url); $params = null; parse_str($response, $params); $_SESSION['access_token'] = $params['access_token']; $graph_url = "https://graph.facebook.com/me?access_token=" . $params['access_token']; $user = json_decode(file_get_contents($graph_url)); echo("Hello " . $user->name); 麻煩大家了 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 1.168.248.90
Fantasywind:那個函式就是取得$token_url那個網頁的原始碼 04/24 18:41
eric541:我之前按照http://ppt.cc/qG7k的方法~調了一下有實作出來 06/06 14:53
eric541:基本上不需要用到什麼套件就可以搞定了~給你參考看看 06/06 14:54