0

quite funny error I get: my script works fine under my account. But on all (!) other account I just see a blank canvas. Here's my script:

<?php
require_once 'src/facebook.php'; 
$app_id = "xx";
$app_secret = "xx";  
$facebook = new Facebook(array(  'appId' => $app_id,  'secret' => $app_secret,  'cookie' => true  ));    
$signed_request = $facebook -> getSignedRequest();    
$locale = $signed_request["user"]["locale"];
if($locale =="de_DE") {
echo "<img src='deutsch.jpg'>";}
else {
echo "<img src='englisch.jpg'>";}
?>

Actually I can't find a failure in it. Do I have to change any permissions, or my canvas-url?

3
  • Maybe you have sandboxing enabled? Also, what does your error log say?
    – Maerlyn
    Jul 18, 2012 at 12:57
  • Sandboxing is not enabled... How do I get the error log? What is interesting: If I start the app it shows me the JPG-Image deutsch, due to my language setting. But all the others just see a blank page Jul 18, 2012 at 12:59
  • The location depends on your system, on my machine it's under /var/log/apache2/error.log .
    – Maerlyn
    Jul 18, 2012 at 13:04

1 Answer 1

0
  1. Your App may be in Sandbox mode (in the developer app under 'Settings > Advanced'). This means that only developers (or testers) of the app can see it.
  2. PHP errors - This might be happening because $signed_request["user"]["locale"] doesn't exist. Try adding

    error_reporting(E_ALL);
    ini_set('display_errors', "1");
    

    to the top of your script and then see what the other users see.

3
  • 1. Sandboxing is disabled. 2. It doensn't show anything... Just a blank Canvas... I will make a screenshot: dl.dropbox.com/u/24841978/… Jul 18, 2012 at 13:07
  • What is the response http status in case of a blank canvas?
    – Maerlyn
    Jul 18, 2012 at 13:13
  • Very interesting: If I use my account FireBug shows: GET app_xxx with HTTP Status 200 OK and one POST command with Status 200 OK. While using any other account, just the GET command appears, but with code 200 OK. Jul 18, 2012 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.