Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy Won't This Work? - It won't show users email address
    primarykey
    data
    text
    <p>Why won't the last line of the above code show the email for the current user? Have being trying to do this for days, I think I have requested the right permission's?</p> <p>Any help is appreciated, might even share a few pound / dollars on PayPal to the person who can help me get out of this mess!</p> <pre><code> &lt;?php /** * Copyright 2011 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ require 'src/facebook.php'; $app_id = "211665122244023"; $canvas_page = "http://apps.facebook.com/midcitymafia/"; $auth_url = "https://www.facebook.com/dialog/oauth?client_id=" . $app_id . "&amp;redirect_uri=" . urlencode($canvas_page) . "&amp;scope=email,publish_actions"; $signed_request = $_REQUEST["signed_request"]; list($encoded_sig, $payload) = explode('.', $signed_request, 2); $data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true); $user_id = $data["user_id"]; if (empty($data["user_id"])) { echo("&lt;script&gt; top.location.href='" . $auth_url . "'&lt;/script&gt;"); } else { $graph1 = file_get_contents ("https://graph.facebook.com/".$user_id . "/?accesstoken=" . $data["oauth_token"]); $graph=json_decode($graph1,true); } $userid = $user_id; $username = $graph['name']; $usergender = $graph['gender']; $useremail = $graph['email']; ?&gt; &lt;br&gt; &lt;?php echo 'ID: ' . $userid; ?&gt; &lt;br&gt; &lt;?php echo 'Name: ' . $username; ?&gt; &lt;br&gt; &lt;?php echo 'Gender: ' . $usergender; ?&gt; &lt;br&gt; &lt;?php echo 'Email: ' . $useremail; ?&gt; </code></pre>
    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. 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