PHP on Facebook Fan Page - is it possible? - php

I am setting up a competition on a Facebook page - i.e. a Facebook Tab Page.
When a fan "likes" the page they are shown a HTML form where they submit their name and email.
I have explored using an Awebber form but this page will/should exceed their max allowed subscriptions per month.
So basically I will set up my own SQL DB and attempt to connect to it from the Facebook page and send the entrant's details to it.
Does Facebook allow you to do this through PHP? Or is there any easier alternative I should try?
Thanks Guys

Facebook Canvas and Tab pages are simply iframes pointing to a page on your server, so yes, you can do normal PHP stuff there.

Yes, you can do this using Facebook's iFrames. They used to use FBML, but that is now deprecated. See this post for more details and great examples on how to get started.
Essentially, you create a page on your own website that is no wider than 520px wide, and point your Facebook page tab to that.

Related

how to count no of likes,shares and reviews of a facebook page in php

I have tried to get number of likes and shares of a facebook page in php. But I didn't get any proper solution for it.Please anyone can suggest me full code to get all these stuffs.Thanks in advance.
Using the Graph API you can retrieve the number of likes for a Facebook page.
https://developers.facebook.com/docs/graph-api/reference/page
In terms of "shares" as in how many times the page has been sent to another person by another it would depend on the tool you are using to share the page; Facebook doesn't track this itself within it's Graph API.
If you have a link on your page that says "Share our Facebook page" you could create something in ajax that would increment a counter on how many times someone had clicked that link, or if you are using a specific plugin to share the page you might be able to use their API to get some sort of count.
Again there is very little information on this question as to the problem you are experiencing, but hopefully this will give you the jumping off point to get started.

How do you share a link, that have POST data?

I am building a website and I am going to add the possibility to share on Facebook, Twitter and Google +. How ever, in some of the sharing codes I have to pass the URL I want to share in a href, the Facebook one gets automatically the actual URL of the page.
My question is: this pages I'm sharing have post data, will the Facebook one work? And what can I do with the other ones that I have to do an href? Is this possible with pages that have post data? If not, what can I do?
Thank you.
You can't. Links can only include plain URLs and make GET requests.
That said, if you want to share a page on social media, it almost certainly isn't appropriate to be requiring a POST request to generate that page in the first place.

Application able to post on user's Wall

I have a Fan Page and I need to post something on users Wall after clicking Like Button. Moreover I need to display different content for users who "Like" the page and for users who don't "Like" the page. Is there an application like "Static iFrame Tab" which already solves this? If not, then how to post something on users Wall? I downloaded the facebook.php file, but I haven't managed to find the required function there.
The user's 'like' status can relatively easily be returned by decoding the signed request sent by Facebook to the page.
I've built a simple fan/like gate that is available over on GitHub - it might help you get up and running.
With regards to posting to the user's wall. I would suggest using the Javascript SDK and reading the FB.ui documentation over on Facebook.

Facebook php login status

I'm trying to do something similar to the login/registration flow described on this page but via php only.
http://developers.facebook.com/docs/plugins/registration/
What I want to do is display a register link if a user is logged in to facebook but not registered with my site, and a login link if they're not logged in to facebook, however I want to do this all on my side in php, and not using the fb:login-button widget. Is this possible?
I have the login url working, i just want to change the name of the button based on the users status.
You can't do it without loading the javascript lib. If you load nothing from Facebook on the client, then there is no way to do cross domain communication (security). Which means there is no way to tell who the user is, much less if they are logged into Facebook. By loading the javascript API on the client, the javascript code can check for a Facebook cookie and determine who they are and whether they are logged into Facebook or not.
Check through javascript and do a page reload if need be. Better yet, just use css to show/hide what you want.
http://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus/
Yes, it is possible. Here's a tutorial:
Tutorial,
Example tutorial

How to login in website using facebook id

I have made a website on which a user has to log in using a username and password. I have seen these in so many website, we can connect through facebook account. And I want to add the same to my web site. How is it possible,using php sdk or the javascript sdk?
The team at Facebook has spent considerable time documenting this, I would suggest you start there:
http://developers.facebook.com/docs/guides/web#login
http://developers.facebook.com/docs/authentication/
If possible, I would do like dracolytch writes here and create a level of abstraction for both OpenID and Facebook. He is willing to share his code.
Those links are what Facebook likes to call "Badges." Go to your profile. Scroll all the way to the bottom. On the lower left hand column you should see a link that says "Create Profile Badge." Click that. From there you can edit a Badge to show the info you'd like. At the end, it will give you some html code that you can copy and paste into another website or blog. When people click on your Badge, they will get sent directly to your Facebook info box.
Source(s):
http://www.facebook.com/badges.php

Categories