title: How to implement facebook login and registration
body: <p>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.</p>
  
  <p>eg.
  Code for registration form</p>
  
  <pre><code>&lt;iframe src="https://www.facebook.com/plugins/registration?
           client_id=&amp;
           redirect_uri=http://localhost:90/store.php&amp;
           fields=name,birthday,gender,location,email"
      scrolling="auto"
      frameborder="no"
      style="border:none"
      allowTransparency="true"
      width="100%"
      height="330"&gt;
  &lt;/iframe&gt;
  </code></pre>
  
  <p>Code for Login button</p>
  
  <pre><code>        &lt;div id="fb-root"&gt;&lt;/div&gt;
  &lt;script&gt;(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&amp;appId=";
    fjs.parentNode.insertBefore(js, fjs);
  }(document, 'script', 'facebook-jssdk'));&lt;/script&gt;
  
  &lt;div class="fb-login-button" data-show-faces="true" data-width="200" data-max-rows="1"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Both are displaying and working respectively, but how do i use these variables?</p>
  
  <p>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.</p>
  
  <p>Any help?</p>