views:

6610

answers:

3

Hi all,

I'm making a facebook iframe application

I'm making a request form with my own form data. What should I do in order to process the data?

If I put action="http://apps.facebook.com/[appName]/abc.php" , i.e.

<fb:serverfbml>
 <script type="text/fbml">
  <fb:fbml>
   <fb:request-form action="http://apps.facebook.com/[appName]/abc.php" method="post" type="abc" content="abc">
    <textarea name="pm" fb_protected="true" ></textarea>
    <fb:multi-friend-selector showborder="false" max="35" actiontext="test" email_invite="true" bypass="cancel" />
   </fb:request-form> 
  </fb:fbml>
 </script>
</fb:serverfbml>

Then the result is funny... A facebook page inside the facebook app's iframe !

but if I put action="http://[my own domain / facebook connect url]/abc.php" , i.e.

<fb:serverfbml>
 <script type="text/fbml">
  <fb:fbml>
   <fb:request-form action="http://[my own domain / facebook connect url]/abc.php" method="post" type="abc" content="abc">
    <textarea name="pm" fb_protected="true" ></textarea>
    <fb:multi-friend-selector showborder="false" max="35" actiontext="test" email_invite="true" bypass="cancel" />
   </fb:request-form> 
  </fb:fbml>
 </script>
</fb:serverfbml>

Then the result page will be rendered WITHOUT facebook template (that means losing all top facebook banner and bottom facebook bar like the facebook chats etc)

Anyone knows what's wrong?

Thanks a lot for reading

+1  A: 

The way I handled this was to have my form processor page emit no output except an "< fb:redirect >" that pointed back to the main app.

Mike Heinz
thx! I also found that using [facebook connect url] will make it unable to receive the form params... do you have any experience of this?
Unreality
Sorry, I haven't worked with facebook connect.
Mike Heinz
+1  A: 

How did you use this < fb:redirect > ?

ok I found it try adding target="_top"

http://apps.facebook.com/myapp' label='Join Now' />" action="http://apps.facebook.com/myapp" target="_top" invite="true">

+1  A: 

The key to the target="_top" is that you have to place it on both the request form and the multi-friend-selector in order for it to work on submit and cancel, respectively.

The request-form needs target="_top" so that the form will load in the top frame when submitted, but the cancel functionality is controlled by the multi-friend-selector, not the request-form. Ergo, you need target="_top" on the multi-friend-selector as well so that the cancel action will load in the top frame.

Now, I just wish Facebook would allow a "none" action for cancel that would just hide the frame...

Ryan Wilson

related questions