Skip links
Published on: invite facebook friends to website

How to invite facebook friends to website in php?

Rate this post

Looking to invite Facebook friends to website? It’s a new way to get more visitors from Facebook.

Step 1: To implement this you have to create a Facebook application & need to set up your webpage URL in that app.

create your Facebook application at https://developers.facebook.com/apps/   (You have to mention your website in  SITE URL)

facebook invite

Step 2:

Source Code: (You have to modify appId value)

<script src=”http://connect.facebook.net/en_US/all.js”></script>
<script>
FB.init({
appId:’499613733406377′,
cookie:true,
status:true,
xfbml:true
});
function FacebookInviteFriends()
{
FB.ui({
method: ‘apprequests’,
message: ‘Invite your friends’
});
}
</script>
<div id=”fb-root”></div>
<a href=’#’ onclick=”FacebookInviteFriends();”>
<img width=”100%” src=”https://lh3.googleusercontent.com/-ESoug2foJBs/T-ntmH-Vs3I/AAAAAAAAGIM/FUQoD54w1oQ/s267/bringfriends.png”>
</a>

Live Demo: