title: getUser always returns 0
body: <p>I have a problem with this piece of code, I search everywhere but didn't get answer for this problem.
  It's my code</p>
  
  <pre><code> &lt;?php
  
        require_once('facebook.php');
  
  
        $facebook = new Facebook(array(
          'appId'  =&gt; 'XXXXXXXXXXXXXXX',
          'secret' =&gt; 'XXXXXXXXXXXXXXX',
          ));
  
        $user_id = $facebook-&gt;getUser();
  
          echo $user_id;
      ?&gt;
  </code></pre>
  
  <p>This code everytime returns 0 even when I'm logged in on facebook with my account, can someone help me to fix this problem or explain what's wrong? I'm using facebook-php-sdk-v3.1.1-21 </p>
  
  <hr>
  
  <p>I want to make something like this, in registration form want to add facebook like button, when user click on this button he become fan of my facebook fan page, if he don't hit like button script must check for this and output error, that before user can register must hit like button, can someone give me some tips or piece of script how to realize this with PHP?</p>