Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if(!isset($_POST['username']))
- $_POST['username'] = '';
- if(!isset($_POST['password']))
- $_POST['password'] = '';
- if (isset($_SESSION['ingelogd'])) header("location: index.php");
- $dbhost = "localhost";
- $dbuser = "pc4u0fi_username";
- $dbpass = "pc4upc4u1";
- $dbname = "pc4u0fi_pc4u";
- $conn = new mysqli($dbhost, $dbuser, $dbpass, $dbname);
- if ($conn->connect_error) die("Connection failed");
- if (isset($_POST['submit'])) {
- $uname = $_POST['username'];
- $wwoord = $_POST['password'];
- $query = 'SELECT * FROM Klanten WHERE klant_username = "' . $uname . '" && klant_password = "' . $wwoord . '"';
- $result = $conn->query($query);
- echo $result;
- if ($result->num_rows == 1) {
- $result = $result->fetch_row();
- $_SESSION['ingelogd'] = true;
- header("location: index.php");
- } else {
- $msg = "Inloggegevens incorrect.";
- }
- //$conn->close();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement