How to Use FBML Tags

How to Use FBML Tags thumbnail
FBML tags allow you to write your own social networking applications.

FBML is an acronym for Facebook markup language. It is part of an application programming interface -- or API -- that allows developers to write code to integrate their systems with the Facebook application. FBML tags are provided by Facebook to allow external developers to develop applications that can be used within Facebook, such as games and custom pages, as well as to use Facebook features on external websites. The FBML tags are categorized according to their functionality and are usually embedded in the source code of a PHP program. Details of how to use each tag, as well as a PHP example, are provided on Facebook’s Developer Reference pages.

Things You'll Need

  • PHP editor
  • Web server
  • MySQL database
Show More

Instructions

    • 1

      Design your application. Make sure to note specific functionality needed to integrate the application with Facebook. For example, decide whether you need user’s names and login credentials or pictures from Facebook.

    • 2

      Create a new application on Facebook by navigating to the site's main Developers page and clicking on the “Create New App” button. Make sure to note the “API Key” and “Secret Key.”

    • 3

      Create a PHP page in your editor by clicking on “File” then “New.” If you are an advanced user, you can create the file in Windows using the Notepad application.

    • 4

      Navigate to the Facebook site's FBML reference page.

    • 5

      Locate the FBML tag you wish to use in your application, and click on it to drill down to its detail page.

    • 6

      Read the detailed explanation of the functionality of the tag, as well as the examples of how to use it in an application.

    • 7

      Write a line of code in your PHP program to call the FBML tag. For example, to get a user’s name using the “fb:name” FBML tag and the profile picture using the “fb:profile-pic” FBML tag, your code would be:

      <?php

      $fb = new Facebook(API_KEY,SECRET_CODE);

      <fb:name uid="$user_id" capitalize="false" />
      <fb:profile-pic uid="$user_id " linked="true" />

      ?>

      You need to pass in the required parameters for each FBML tag, which is the user ID in these two examples.

    • 8

      Include additional code for any required processing and any needed FBML tags.

Related Searches:

References

Resources

  • Photo Credit Thomas Northcut/Photodisc/Getty Images

Comments

Related Ads

Featured