Update: Facebook’s move to enable page tabs based on HTML iframes rather than FBML makes the specific techniques discussed below obsolete. Today I recommend instead using my Facebook Tab Manager for WordPress if your site is on WordPress. If you are not on WordPress, you should find that the task of integrating custom content including contact forms is now easier, overall.
This is a simple code generator to produce a sales lead capture form to be embedded in a Facebook page.
What I’ve done here is try to automate the process of creating a Facebook-compatible block of code that you can add as a tab on your Facebook page using the Static FBML tool provided by Facebook. This is a hack, but it works. Submit the form below, and you’ll get the FBML for the form, sample MySQL create table code for storing the data, and a sample PHP script for storing the data in the database. The PHP sample uses WordPress database routines, but you can substitute the database framework of your choice.
This is set up to be a sales lead capture form, but it can be modified to serve as the starting point for any data entry application you might want to make available to Facebook users. I welcome feedback from Facebook developers who can recommend ways this could be improved to be more functional or secure.
Of course, the server side of the equation doesn’t necessarily need to be PHP / MySQL. You could also use this tool to create a front-end data entry form to an existing web app written in any language, as long as the HTML/FBML form fields match your database schema and your server script can echo back an appropriate AJAX-style response.