With Facebook Bookmark Button users can bookmark your website inside the Facebook environment and later on easily navigate back. The bookmark will be placed on left column of the user's Facebook homepage.

This class is a member of Facebook PHP SDK. To see all classes from the toolkit, please look at the Facebook PHP SDK classes.

Bookmark Button Image

Following image shows Bookmark Button and Bookmark Dialog which appears when the button is pressed.

facebook bookmark button

PHP Example

The example shows PHP code to create the Facebook Bookmark Button from picture above. The example shows the code of whole page, but important content is highlighted: required includes and initialization for any page with brown color, and working with Facebook Bookmark Button PHP class with blue color.

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
       <title>Facebook Bookmark Button PHP Example</title>
            require_once 'facebook.php';
            require_once 'faceconn/faceconn.php';

            $bookmark = new Bookmark();

Facebook Bookmark Button PHP class has a demo page inside Demo Website where it can be seen how it works. The most important fact is that the Demo website is contained in package with Facebook Connect PHP Toolkit which is very useful resource of code examples for each class from the toolkit. Look at the Facebook Bookmark Button Demo page.


Configuration of Facebook Bookmark Button PHP class is done through calls of the setter methods, which in turn set the private properties. For Facebook Bookmark class, there is only one mandatory and couple of optional properties to set. After the configuration is set, all you have to do is to call Render() method, and the control will display on page.

facebook bookmark button php
Method Name
facebook bookmark button php
Call this function with parameter set to false if bookmark button is used inside Facebook application instead of Facebook Connect website.