tags:

views:

93

answers:

2

Hi,

I want to request permissions when the user first clicks my iFrame Facebook application. The problem is the examples I have seen force the user to click a button to load the http://www.facebook.com/authorize.php URL.

Is there a way to iframe the authorize.php page in my application? I've seen it done before but can't find out how.

If I currently try it, it shows the "go to facebook box". The method I seen changes the href or something on the browser.

Any ideas?

+1  A: 

I do something like this in one of my iframe applications (I've simplified the actual code for this example)

$fbSession = $facebook->getSession();
if ( $fbSession )
{
  $url = $facebook->getLoginUrl( array(
      'canvas'    => 1
    , 'fbconnect' => 0
    , 'req_perms' => 'list,of,perms'
    , 'display'   => 'page'
  ) );
  include( 'redirect.php' );
  exit;
}

Then, redirect.php

<script type="text/javascript">
  top.location.href = '<?php echo $url; ?>';
</script>
<p>
Not being redirected? <a href="<?php echo $url; ?>" target="_top">Click Here.</a>
</p>
Peter Bailey
A: 

no need to complicate: target="_top" is the answer!

Best!

m

Michael

related questions