1

I am trying to use facebook login and registration on my web page. My webpage is curerntly hosted on localhost and both Facebook login and Register CODE are working properly. But i cannot figure out how do i use that data to store and write php code.

eg. Code for registration form

<iframe src="https://www.facebook.com/plugins/registration?
         client_id=&
         redirect_uri=http://localhost:90/store.php&
         fields=name,birthday,gender,location,email"
    scrolling="auto"
    frameborder="no"
    style="border:none"
    allowTransparency="true"
    width="100%"
    height="330">
</iframe>

Code for Login button

        <div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-login-button" data-show-faces="true" data-width="200" data-max-rows="1"></div>

Both are displaying and working respectively, but how do i use these variables?

How do i check whether user is already logged in? if not, how do i make him login and redirect to another page with his info. Mainly i dont see any variables in this code to use.

Any help?

4

1 回答 1

0

您是否阅读了注册插件文档: http: //developers.facebook.com/docs/plugins/registration/ 您也可以在那里找到示例。

于 2013-04-24T18:54:38.633 回答