Jetzt ist er fertig lol
This commit is contained in:
parent
f2bdf4dd9d
commit
2b8f19d692
3 changed files with 41 additions and 18 deletions
32
index.php
32
index.php
|
@ -5,17 +5,28 @@
|
|||
|
||||
<?php
|
||||
|
||||
// session_start();
|
||||
// if (!isset($_SESSION['id'])){
|
||||
// echo '<h1>Nicht eingeloggt!</h1>';
|
||||
// echo '<form action="/login.php" method="post">' .
|
||||
// 'Username:<input type="text" name="user">' .
|
||||
// 'Passwort:<input type="password" name="pw">' .
|
||||
// '<input type="submit" value="Login">' .
|
||||
// '</form>';
|
||||
// return;
|
||||
// }
|
||||
|
||||
session_start();
|
||||
// $_SESSION['Test'] = 'VerrückterMongoJunge';
|
||||
// echo '<pre>' . $_SESSION['Test'] . '</pre>' ;
|
||||
if (!isset($_SESSION['id'])){
|
||||
echo '<h1>Nicht eingeloggt!</h1>';
|
||||
echo '<form action="/login.php" method="post">' .
|
||||
'Username:<input type="text" name="user">' .
|
||||
'Passwort:<input type="password" name="pw">' .
|
||||
'<input type="submit" value="Login">' .
|
||||
'</form>';
|
||||
return;
|
||||
echo '<div class="form">' .
|
||||
'<form action="/login.php" method="post">' .
|
||||
'<input type="text" placeholder="Username" name="user">' .
|
||||
'<input type="password" placeholder="Password" name="pw">' .
|
||||
'<input type="submit" value="Login">' .
|
||||
'</form>' .
|
||||
'</div>';
|
||||
return;
|
||||
}
|
||||
|
||||
$cockDatabase = "dulow";
|
||||
|
@ -85,8 +96,3 @@ Text:<input type="text" name="author"><br>
|
|||
URL:<input type="text" name="url"><br>
|
||||
<input type="submit" value="Hinzufügen">
|
||||
</form>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
?>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
$sql = "SELECT id FROM users WHERE user='". $_POST['user'] .
|
||||
"' AND pw='". $_POST['pw'] ."' ";
|
||||
$result = $conn->query($sql);
|
||||
// echo $result->fetch_array()['id'];
|
||||
|
||||
if ($result->num_rows == 1) {
|
||||
$_SESSION['id'] = $result->fetch_array()['id'];
|
||||
}
|
||||
|
|
25
style.css
25
style.css
|
@ -49,8 +49,25 @@ table.center {
|
|||
margin-right: auto;
|
||||
margin-top: 200px;
|
||||
}
|
||||
form {
|
||||
margin-left: 50%;
|
||||
margin-right: 50%;
|
||||
margin-top: 250px;
|
||||
|
||||
.form {
|
||||
max-width: 360px;
|
||||
margin: 0 auto;
|
||||
padding: 30px;
|
||||
padding-bottom: 0px;
|
||||
background: rgba(18,18,18, 0.3);
|
||||
border: 2px solid #DDDDDD;
|
||||
}
|
||||
.form input {
|
||||
width: 100%;
|
||||
margin: 0 0 15px;
|
||||
box-sizing: border-box;
|
||||
font-size: 16px;
|
||||
padding: 10px;
|
||||
border: 2px solid #DDDDDD;
|
||||
color: #000000;
|
||||
background-color: white;
|
||||
}
|
||||
.form button:hover,.form button:active,.form button:focus {
|
||||
background: #43A047;
|
||||
}
|
||||
|
|
Reference in a new issue