title: Facebook authentication window as pop up
body: <p>I got the following code from <a href="http://nocturnsoft.com/devblog/?p=174" rel="nofollow">http://nocturnsoft.com/devblog/?p=174</a> site and everything is working fine. But running into a small UI issue. The login window is not opening in a pop up. Am I suppose to include the js sdk or just use a different code. The pop up is critical part as I will be calling the page with in and iFrame.</p>
  
  <p>Thanks in advance.</p>
  
  <pre><code>require_once "src/facebook.php";
  
  $app_id = "xxx";
  $app_secret = "xxx";
  
  // Init facebook api.
  $facebook = new Facebook(array(
          'appId' =&gt; $app_id,
          'secret' =&gt; $app_secret,
          'cookie' =&gt; true
  ));
  
  // Get the url to redirect for login to facebook
  // and request permission to write on the user's wall.
  $login_url = $facebook-&gt;getLoginUrl(
      array('scope' =&gt; 'publish_stream')
  );
  
  // If not authenticated, redirect to the facebook login dialog.
  // The $login_url will take care of redirecting back to us
  // after successful login.
  if (! $facebook-&gt;getUser()) {
      echo &lt;&lt;&lt; EOT
  &lt;script type="text/javascript"&gt;
  top.location.href = "$login_url";
  &lt;/script&gt;;
  EOT;
  
      exit;
  }
  
  // Do the wall post.
  $facebook-&gt;api("/me/feed", "post", array(
      message =&gt; "Testing Wall post",
      picture =&gt; "http://www.cjp.org/display_image.aspx?ID=348063",
      link =&gt; "http://www.cjp.org",
      name =&gt; "Combined Jewish Philanthropies",
      caption =&gt; "The Jewish Federations of North America"
  ));
  </code></pre>