Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('database.php');
- $sql = "SELECT * from user";
- $result = mysqli_query($conn, $sql);
- if(isset($_POST['uName'] && isset($_POST['uPass'])))
- {
- // User is trying to authenticate
- // MD5 for the password
- // Retrieve the password from DB
- // See if they match
- // User is home:
- echo "Hello, " . $_POST['iName'] . " ". md5($_POST['iName']);
- // User is rejected:
- }
- else
- {
- echo "
- <html>
- <title>
- Register
- </title>
- <body>
- ";
- /*
- if(mysqli_num_rows($result) > 0)
- {
- while($row = mysqli_fetch_assoc($result))
- {
- echo "<tr> <td>id</td><td>".$row["id"] . "</td><td>name</td><td>" . $row["name"] . "</td></tr>";
- }
- }
- else
- {
- echo "0 results.";
- }
- */
- echo "
- Enter your username, password and other required data...
- <form action=\"loginReader.php\" method=\"POST\">
- Username: <input type=\"text\" id=\"uName\" name=\"uName\" size=\"20\"/>
- <br/>
- Password: <input type=\"password\" name=\"uPass\" id=\"uPass\" size=\"20\"/>
- <br/>
- <input type=\"submit\" value=\"LOGIN!\"/>
- <br/>
- </form>
- <a href=\"register.php\">Register</a>
- </body>
- </html>
- ";
- }
- mysqli_close($conn);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement