Implement Facebook – Javascript SDK with PHP

/, Social Media/Implement Facebook – Javascript SDK with PHP

Implement Facebook – Javascript SDK with PHP

Social networking continues to grow and Facebook continues to define lives of many people. Facebook button these days is considered to be an integral part of every webpage and Facebook marketing is perhaps the prime form of internet marketing. The Facebook page is the dire need of every business and page comments provide the best feedback. However, this form of e-marketing implementation sometimes gets harder than you may think and also is the cause of problems. For example, the straightforward method of implementing the Facebook ‘like’ button involves iFrame which have caused many users to experience security flashes while they tried opening the page.

The use of JavaScript SDK is, thus essential to make sure that Facebook plug-ins such as the Like button or Like Box is compatible and usable with secure HTTPS pages.

Begin with getting an Application ID from the following address:

Then, try and create a PHP page which will run the JaveScript SDK on an HTTP pag. One of the most commonly used Facebook social plug-ins is the Like button. Unfortunately, it doesn’t work perfectly in an HTTPS environment, without the use of JavaScript SDK. Once this is working, you will have to go to the following page:

and here you can configure your own Facebook like button code. Then, you will have to get the XFBML version of the button which will be again in the form of a code. After alterations as you may like, embed/ paste the button code within the PHP version. Then, try saving the script, and then upload it on web server and then, open it in the browser as follows:

This will remove any warnings that you may have seen before, when you were using conventional iFrame method. You can then move on and integrate it in any CMS such as WordPress or Joomla. After this implementation, the code in your single.php, page.php or in any other templates will make the button appear on the web page. Remember to save any changes that you make!

To make use of Facebook Comments in HTTPS websites, you can again use the JaveScript SDK. Begin with logging into the CMS administrator panel and then decide the position of your comments plug-in. Then, add the comments code (XFMBL version). You can generate one here:

Save the template and add meta property. Then you can move on to configuring the Facebook comments ( and soon the installation of your plug-in will be completed.

By |2018-04-19T19:55:51-05:00July 8th, 2012|Categories: Facebook, Social Media|Comments Off on Implement Facebook – Javascript SDK with PHP

About the Author: provides FREE computer training on products like Microsoft Windows, Microsoft Office, Microsoft Word 2013, Microsoft Excel 2013, Mozilla Firefox, Microsoft Powerpoint, Microsoft Access, Visual Basic, Internet Explorer, Java, SQL Server 2012, eBay, Windows XP and many more topics on IT training and computer learning.