Reference Guide
facebook FBML Reference Guide Page 84 of 159
When the user clicks your "attach" link, Facebook calls your script and displays it in a pop-up dialog like the
one below. Each time the user clicks the "Preview" link, Facebook calls your attach script again with the values
of the form inputs as POST variables, and updates the dialog with whatever your script returns.
"Preview" screenshot from the sample code
When the users clicks the "Attach" button, your script will be called with the POST variable message_sent set to
1, and uses your script's output as the attachment:
"Attached" screenshot from the sample code
You're given the user doing the attachment as fb_sig_user, but remember that users who don't have your app
installed can still make attachments on their friends' walls (in this case you won't be given fb_sig_user).
Elements Needed/Steps
1) Go to My Applications and click on Edit Settings for your app.
a) At the bottom, under Attachments, for "Attachment Action:" type in the text you'd like to appear in the wall
attachment area. For example "Attach Photo" or "Slap x"
b) In "Callback URL:" type in the URL to where you will house your code, i.e. attach.php. Include the full URL
and have it be the URL of your site, not the apps.facebook.com URL. For example,
http://www.yourserver.com/attach.php
2) On your callback for attachment page, you will need to have field inputs where the name is 'url' and the value
is the URL to the page where you will display what they chose. For example:
www.yapish.com










