簡單說明一下
比如有一網址: http://example.com/apps
在用戶第一次進入此網址時,則要求用戶給予相應的權限 (自動跳轉到 Facebook 的授權頁面)
在用戶第二次進入此網址時,就不再請求,而可直接應用
相關的語法如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| <?php
echo "This is a test";
$q = http_build_query(array( "api_key" => "[應用程式的 APP ID]", "cancel_url" => "http://zeuik.com/index.php", "display" => "page", "fbconnect" => 0, "next" => "http://zeuik.com/youtube/video.php?id=1", "return_session" => 1, "session_version" => 3, "v" => "1.0", "canvas" => 1, "req_perms" => "email,publish_stream,user_photo_video_tags,user_photos,friends_photo_video_tags,friends_photos,photo_upload" )); ?>
<script type='text/javascript'>top.location.href = 'https://www.facebook.com/login.php?<?php echo $q; ?>';</script>
|