I created a facebook application using the Javascript SDK. It works fine for me (perhaps because the application is associated with my account), but it does not work for other users. When the user clicks the login button, a dialog box appears and asks for the username and password of the facebook user. But then the dialog disappears, and the login button still exists. When the user clicks the Login button again or refreshes the page, a dialog box will appear and disappear very quickly. The user logs into his facebook account, but he is not logged into the application.
Here is a sample code:
<div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId : 'xxxxxxxxxxx', </script> <fb:login-button show-faces="true" width="200" max-rows="1"></fb:login-button> <br> <div id="login-form"> <form action="" method="POST" onsubmit="submit();return false;"> Name: <input type="text" name="name" id="name" placeholder="Name"> Email: <input type="email" name="email" id="email" placeholder="Email" disabled> Password: <input type="password" name="pwd" placeholder="Password"> Re-Password: <input type="password" placeholder="Re-Type Password"> College: <select name="college"> <?php include "./connect.php"; $query="select * from college"; $result=mysqli_query($con,$query) or die(mysqli_error($con)); while ($row=mysqli_fetch_array($result)) { echo "<option value='".$row['ID']."'>".$row['NAME']."</option>"; } ?> </select> </form> <button onclick="submit()">Submit</button> </div> <button onclick="logout()">Logout</button>
source share