Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['submit'])) {
- $username = $_POST['username'];
- $password = md5($_POST['password']);
- $logincheck = $stmt = $con->prepare("SELECT * FROM users WHERE username=:username and password=:password");
- $stmt->bindParam(':username', $username);
- $stmt->bindParam(':password', $password);
- $stmt->execute();
- $rows = $stmt->fetch(PDO::FETCH_NUM);
- if($rows > 0) {
- exit(header('Location: index.php'));
- }
- }
- ?>
- <form method="post">
- <input type="text" name="username">
- <input type="password" name="password">
- <input type="submit" name="submit">
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement