Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>Registreren</title>
- </head>
- <body>
- <h1>Persoon Inloggen</h1>
- <form action="" method="post" enctype="multipart/form-data">
- <dl>
- <dt><label for="emails_home">email:</label></dt>
- <dd><input id="emails_home" name="emails_home" type="text" value="<?php echo @$_POST['emails_home']; ?>" placeholder="Geef hier je email in" /></dd>
- <dt><label for="paswoord">Paswoord:</label></dt>
- <dd><input id="paswoord" name="paswoord" type="password" value="<?php echo @$_POST['paswoord']; ?>" placeholder="Geef hier een paswoord in" /></dd>
- <dd><input name="submit" type="submit" value="Log in" /></dd>
- </dl>
- <div id="result"></div>
- <a href="registreren.php">registreren</a>
- </form>
- <?php
- session_start();
- if ( !empty($_POST) && isset($_POST['submit']) ) {
- $emails_home = $_POST['emails_home'];
- $paswoord = $_POST['paswoord'];
- if(empty($emails_home) || empty($paswoord)) die('Vul alle waarden in');
- require_once '../application/db.php';
- $sql="SELECT * FROM users WHERE emails_home=? and password=?";
- if ($stmt = $db->prepare($sql)) {
- $stmt->bind_param('ss', $emails_home, $paswoord);
- $stmt->execute();
- if ( $stmt->fetch() ) {
- $_SESSION['loggedIn'] = true;
- $user = array(
- "emails_home" =>$user_row["emails_home"],
- "lastname" =>$user_row["lastname"],
- "firstname" =>$user_row["firstname"]
- );
- $_SESSION["user"] = $user;
- $URL="ingelogd.php";
- header ("Location: $URL");
- } else {
- echo 'alias of paswoord niet correct';
- }
- $stmt->close();
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement