Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'mysql.php';
- $username = $_POST['username'];
- $password = $_POST['password'];
- $query = "SELECT * FROM `user` WHERE username='$username' and password='$password'";
- $result = mysqli_query($connection, $query) or die(mysqli_error($connection));
- $count = mysqli_num_rows($result);
- if ($count == 1) {
- echo "You are logged in as " . $username;
- }
- else {
- header('Location: index.html');
- }
- ?>
- <br><br><a href="index.html">Logout</a>
Add Comment
Please, Sign In to add comment