phpfacebookuser-interfacex-facebook-platform

Simple Facebook connection with my web site


In one of my web page I need to show the username , well this is a public chat page. My requirement is if that user is logined in facebook then need to show his name and profile pic other wise prompt for entering new username ?

Any facebook plugin available for this ?

Please help Thanks


Solution

  • http://developers.facebook.com/docs/guides/web/#personalization

    Part of the example they show:

    FB.api('/me', function(user) {
            if (user) {
              var image = document.getElementById('image');
              image.src = 'http://graph.facebook.com/' + user.id + '/picture';
              var name = document.getElementById('name');
              name.innerHTML = user.name
            }
          });
    

    I believe the only way you can get this info is by having Facebook login.