Website Log In with Facebook - PHP

I am working on my website on PHP, and at some point, it is required to have a membership. I added the "Login with Facebook" but it is not working with me fully. When the user clicks on Login with facebook, it takes him/her to facebook and it returns him/her back to my website with a very big code that I do not know what to do with it.

The return URL is :

My login page is as per below:


I already uploaded the files from GetHub ""
Facebook files

- What should i write inside the login.php to get the user details ? I need the email at least.
- How to understand the return URL?
zoscoitNetwork AdministratorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Olaf DoschkeSoftware DeveloperCommented:
Read this thoroughly:
The URL code parameter says nothing to you, it's for FB to know your request is genuine and also encodes what permissions you'll want, it doesn't yet give you the email, the login didn't yet occur, you're pre-login here.

The result of the request is what you're interested in, and you should not let the login.php callback to itself, or you don't have a good distinction between before and after login.

As in the example, let getLoginUrl create a URL, which calls a login-callback.php page of your website and then do something along the lines of the login-callback.php sample code.

Bye, Olaf.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Olaf DoschkeSoftware DeveloperCommented:
The answers explains how this works pretty straight forward.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.