Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="login_controller.php" method="POST">
- <span class="user_label">Username: </span>
- <input class="username" type="text" name="username"><p>
- <span class="pass_label">Password: </span>
- <input class="password" type="password" name="password"><p>
- <input class="submit" type="submit" name="submit" value="Login">
- </form>
- <?php
- require_once 'config/config.php';
- if (isset($_POST['submit']) && $_POST['submit'] == 'Login') {
- $username = $_POST['username'];
- $password = $_POST['password'];
- if (!empty($username) && !empty($password)) {
- $users_count = $pdo->query("SELECT COUNT(username)
- FROM users
- WHERE username = {$username}");
- $count_all = $users_count->fetchColumn();
- print_r($count_all);
- }
- else {
- header('Location: login.php');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement