-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathregistration_mail.php
More file actions
36 lines (32 loc) · 904 Bytes
/
registration_mail.php
File metadata and controls
36 lines (32 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!Doctype html>
<html>
<head>
<title>test</title>
</head>
<body>
<input type="text" required />
<input type="text" required />
</body>
</html>
<?php
$db = new PDO('mysql:host=localhost;dbname=users', 'root', '');
$db->query('Set names utf8');
$daten = $db->query('Select username , password from user ');
var_dump($db->errorInfo());
$login = false;
if (isset($daten) && isset($_POST["username"]) && isset($_POST["password"])) {
foreach ($daten as $user) {
echo $user["password"];
if ($user["username"] == $_POST["username"] && $user["password"] == $_POST['password']) {
$login = true;
}
}
}
if ($login == true) {
$_SESSION['angemeldet' . $_POST['username']] = true;
setcookie('user', $_POST['username'], 0 , "/" );
header('Location: controlinterface');
} else {
header('Location: webinterface');
}
?>