Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('db.php');
- session_start();
- // username and password sent from form
- $gebruiker=$_POST['gebruiker'];
- $passwoord=$_POST['passwoord'];
- // To protect MySQL injection (more detail about MySQL injection)
- $gebruiker = stripslashes($gebruiker);
- $passwoord = stripslashes($passwoord);
- $gebruiker = mysqli_real_escape_string($conn, $gebruiker);
- $passwoord = mysqli_real_escape_string($conn, $passwoord);
- $encryptpass = md5($passwoord);
- $sql="SELECT * FROM Gebruikers WHERE gebruiker='$gebruiker' and passwoord='$encryptpass'";
- $result=mysqli_query($conn, $sql);
- function is_user_logged_in() {
- $user = wp_get_current_user();
- return $user->exists();
- }
- // Mysql_num_row is counting table row
- $count=mysqli_num_rows($result);
- // If result matched $gebruiker and $passwoord, table row must be 1 row
- if($count==1){
- $_SESSION['loggedin'] = true;
- $_SESSION['gebruiker'] = $gebruiker;
- header('location:index.php');
- }
- else
- {
- echo "Gebruikersnaam of passwoord is niet juist";
- }
- mysqli_close($conn);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement