so i basically have 2 roles in my database which are sollicitant and bedrijf i wanna redirect them both to a different page, i now have a script which controls the email and password in my database but i have no idea how to "check" which role they have so they both can be redirected to a different welcome page
this is my code that checks the password and email but not the role.. how do i redirect both roles to a different page?
<?php
if(isset($_POST['verzenden'])) {
$inputEmail = htmlspecialchars($_POST['email']);
$inputWachtwoord = htmlspecialchars($_POST['wachtwoord']);
$servername = "localhost";
$databasename = "powerjobs";
$username = "root";
$password = "";
try {
$conn = new PDO("mysql:host=$servername; dbname=$databasename", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch(PDOException $e) {
echo "Connection failed: " . $e->getMessage();
return;
}
try {
$stmt = $conn->prepare("SELECT * FROM registratie WHERE email = '$inputEmail'");
$stmt->execute();
$result = $stmt->setFetchMode(PDO::FETCH_ASSOC);
$row = $stmt->fetch();
$rowCount = $stmt->rowCount();
if ($rowCount) {
if ($inputWachtwoord == $row['wachtwoord'])
header("Location: sollicitant.html");
else
echo "<br/>Gebruikersnaam en wachtwoord komen niet overeen.";
} else {
echo "<br/>Login failed, no record found";
}
}
catch(PDOException $e) {
echo "Error: " . $e->getMessage();
}
$conn = null;
session_start();
$_SESSION["login"] = true;
$_SESSION["email"] = $inputEmail;
}
?>