Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- INCLUDE("dbConnect.php");
- session_start();
- $_SESSION['loggedIn'] = false;
- if (isset($_POST['SubmitProjectRdv'])) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $SQL = "SELECT * FROM `users` WHERE `name` LIKE '$username' AND `password` LIKE '$password'";
- //die($SQL);
- $result = mysqli_query($conn, $SQL);
- if($result != false)
- {
- //something went wrong, query is not correct or something else happened.
- if(mysqli_num_rows($result) > 0)
- {
- //database shows at least 1 record (tupel) so the combination of username and password does exist.
- $_SESSION['loggedIn'] = true;
- //echo "super";
- header('Location: cms.php');
- }
- else
- {
- //database does not contain the username and password combination.
- $_SESSION['loggedIn'] = false;
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement