The most up to date PHP + Javascript SDK sample is found here: https://developers.facebook.com/blog/post/534/ - Facebook's backend requires oauth2.0 enabled on your app and it may be easier to just copy + paste a working app, then tweak it to your requirements.