Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yes. There is <code>signed_request</code> (POST), with Page ID... You cannot get entire URL because request is going trough Facebook proxy. Here is the way how you can do it, later just serve content based on Page ID...</p> <pre><code> $signed_request = $_POST['signed_request']; $response = Facebook::parse($signed_request); $page_id = $response['page']['id']; </code></pre> <p>(this is just the part of my class)</p> <pre><code>class Facebook { // Facebook signed request parser public static function parse($signed) { list($encoded, $payload) = explode('.', $signed, 2); $sig = Facebook::base64_url_decode($encoded); $data = json_decode(Facebook::base64_url_decode($payload), true); if(strtoupper($data['algorithm']) !== 'HMAC-SHA256'){ error_log('Unknown algorithm. Expected HMAC-SHA256'); return false; } return $data; } // Base64 decode for Facebook private static function base64_url_decode($input) { return base64_decode(strtr($input, '-_', '+/')); } } </code></pre> <p>edit:</p> <p>Like you have said, you need to authorize app only once per user, and you will be able to use it across all pages (I have hundreds of them). This is output of signed_request when user is "connected" to app.</p> <pre><code>Array ( [algorithm] =&gt; HMAC-SHA256 [expires] =&gt; 0 [issued_at] =&gt; 1311062412 [oauth_token] =&gt; [page] =&gt; Array ( [id] =&gt; 149715315100385 [liked] =&gt; 1 [admin] =&gt; 1 ) [user] =&gt; Array ( [country] =&gt; ba [locale] =&gt; en_US [age] =&gt; Array ( [min] =&gt; 21 ) ) [user_id] =&gt; 1368368917 ) </code></pre> <p>You can see page->id, a user_id, also you will get token for accessing user info (for those you have permission).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload