Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $host = "localhost";
- $sqlusername = "SQL Username HIER";
- $sqlpassword = "SQL Wachtwoord HIER";
- $dbnaam = "Database naam HIER";
- $tabelnaam = "login";
- $con = mysqli_connect("$host", "$sqlusername", "$sqlpassword", "$db_name")or die("Kan niet connecten naar MySQL!");
- $username = $_POST['username'];
- $password = $_POST['password'];
- $sql = "SELECT * FROM $tbl_name WHERE username='$username' and password='$password";
- $result = mysqli_query($con, $sql);
- $count = mysqli_num_rows($result);
- if($count == 1){
- $_SESSION['username']=$username;
- $_SESSION['password']=$password;
- header('Location: login_success.php');
- }
- else {
- echo "Verkeerde naam, of wachtwoord";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement