Create working example of Facebook API login in PHP using latest FB PHP SDK

Hello excellent coder!


I need a Facebook login written in PHP.

Use the latest PHP SDK from Facebook.

Use their demo code as a starting point.

Do the normal PHP Facebook login flow, as per their documentation.

Extend the user access token to a long-lived token.

Then assume the user has many Facebook pages, and wants to publish to one of their Facebook pages.

Get the list of Facebook pages.

Let the user choose one.

Get a page access token for that page.

The page access token will automatically be long-lived, if you have already made the user access token long-lived.


More detail…


Permissions required: email, publish_stream

Basic login:

1. Show Facebook button on page.

2. User clicks button to begin Facebook login.

3. User authenticates with Facebook.

4. User is sent back to my server’s callback URL (you can set this to anything - I will adjust it later)

5. Get the Facebook access token.

6. Make a request to Facebook to extend the access token and make it into a long-lived access token

Facebook pages :

7. Make a request for the list of user’s Facebook pages.

If there are any pages found…

8. Show list of pages in a HTML drop down combo box (if user has pages - please make sure to write code and test this scenario)

9. User chooses a page from the list.

10. Make a request for a page access token that matches the chosen Facebook page. Ask for the permissions that are required to publish to page: manage_pages, publish_pages (both are required)

Final output:

11. Create PHP variables or arrays for these things:

- Facebook ID

- permissions that were requested (for user login, and for pages if any)

- permissions that were granted by the user (for user login, and for pages if any)

- permissions that were denied by the user (for user login, and for pages if any)

- list of Facebook pages managed by the user

- page ID (or some other identifier such as URL, etc) of the page that the user chooses

- access token (the long-lived token string for the user)

- expiry

- page access token (long-lived token for the page access, if a page was chosen by the user)

12. Output all these variables to the screen.

End ! :)


Please use your own server to test your code with Facebook.

Please use your own Facebook accounts to test the login. You might want to set up a new Facebook account as a test to use with this job, so you do not have to risk your personal Facebook account.

Add at least 2 Facebook pages to your account, if you need to, so you can test the pages feature.

When finished, and everything works perfectly, please send me a zip file of the PHP code, including the latest Facebook SDK that you used.



I know you work hard, and I like to pay well for good work.

Compétences : PHP

en voir plus : up working, sdk facebook php, required in php, php string to html, php demo code, login page create in php, i want create a facebook account, i want a new facebook account, i need a facebook id, html 5 api, get a coder login, do i need a facebook account, create a login page php, combo box html 5, fb.api, callback url, write api using php, sdk api, php facebook, php code test

Concernant l'employeur :
( 102 commentaires ) North Ward, Australia

Nº du projet : #7638722

Décerné à:


Dear Sir or Madam, I'm web developer with a lot of experience with different programming languages (PHP/MySQL/CSS/HTML/JS ... ). I can create a working example of FB API login and obtaining the variables you want Plus

%selectedBids___i_sum_sub_7% %project_currencyDetails_sign_sub_8% AUD en 2 jours
(57 Commentaires)

9 freelance font une offre moyenne de $45 pour ce travail


Hi, Hope you doing well I am a PHP Developer, have experience of 4yr in PHP and a vast amount of experience in the area of ecommerce sites. I have accomplished many wordpress projects. I am very capable and willing to Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% AUD en 1 jour
(29 Commentaires)

ILM Techno Solution.Pvt.Ltd. ILM Okya Blue Silicon,sec-62, Noida, India. Skyp=[login to view URL] [login to view URL] [login to view URL] About ILM ===================================== Welcome to ILM Techno Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% AUD en 1 jour
(15 Commentaires)

Hello, I am akil khatri with my 25+ member team with limited skills and unlimited ideas in Game Development|iPhone|Android|Mobile App Development|PHP|Joomla|Wordpress|Javascript|Java| and |.Net|3D Animation|3D Max| wi Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% AUD en 1 jour
(10 Commentaires)

Hello i worked to much on 'login by facebook/twitter' APIs. I can do your work in just 1-2 hour. Kindly award me to get it done quickly.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% AUD en 1 jour
(4 Commentaires)

hi i can do this but are you telling me that 25AUD is paying well? i hope you will throw some numbers at me to make it worth my while to do this simple task for you! i look forward to see you smile!

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% AUD en 1 jour
(2 Commentaires)

A proposal has not yet been provided

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% AUD en 1 jour
(0 Commentaires)

CyberSpace Technology [login to view URL] [login to view URL] [login to view URL] [login to view URL] [login to view URL] [login to view URL] http Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% AUD en 1 jour
(0 Commentaires)

Hello, Please have a look on below link which was made for similar requirement: [login to view URL] In this; 1 extra thing is login and routine signup methods on signup screen. We ca Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% AUD en 3 jours
(0 Commentaires)

Can I help you? I'm can make for you. Demo: login facebook: [login to view URL] I'm made very the projects with a lot of framework PHP: wordpress, joomla, magento, cakephp, codeigniter, ...

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% AUD en 3 jours
(0 Commentaires)