HTML:
<!doctype html>
<html>
<head>
<title>Log in</title>
</head>
<body>
<form action="login.php" method="post">
Name: <input type="text" name="name" /><br>
E-mail: <input type="email" name="email" /><br>
<input type="submit" name="submit" value="Log In">
</form>
<?php
$host = "localhost";
$user = "root";
$pass = "password";
$db = "mysqltutorials";
mysql_connect($host, $user, $pass);
mysql_select_db($db);
if(isset($_POST['submit'])){
$name = $_POST['name'];
$email = $_POST['email'];
$sql = "SELECT * FROM randomtable WHERE Name='".$name."' AND Email='".$email."' LIMIT 1";
$res = mysql_query($sql);
if(mysql_num_rows($res) == 1) {
echo 'Je bent ingelogd';
exit();
} else {
echo 'Je bent niet ingelogd';
exit();
}
}
?>
Ik heb zelf dit Log In script gemaakt en het werkt helemaal goed.
Alleen ik wil (nadat ik ben ingelogd) dat ik wordt doorgestuurd naar een volgende pagina, weet iemand hoe ik dat doe?