diff --git a/index.php b/index.php index 85d750f..e2f320b 100644 --- a/index.php +++ b/index.php @@ -4,28 +4,7 @@ Nicht eingeloggt!'; - echo '
' . - '
' . - '' . - '' . - '' . - '
' . - '
'; - return; -} - -if (isset($_SESSION['id'])){ - echo '

Hier klicken zum Ausloggen!

'; - echo '
' . - '
' . - '' . - '
' . - '
'; -} $cockDatabase = "dulow"; $host = "localhost"; @@ -89,8 +68,41 @@ $number++; ?>
-
-Text:
-URL:
- -
+ + +Nicht eingeloggt!'; + echo '
' . + '
' . + '' . + '' . + '' . + '
' . + '
'; + if (isset ($_SESSION['status'])){ + echo $_SESSION['status']; + } + return; +} +?> + +' . + '
' . + '
' . + '' . + '
' . + ''; +?> + +Hier klicken zum Ausloggen!'; + echo '
' . + '
' . + '' . + '
' . + '
'; +} +?> diff --git a/insert.php b/insert.php index 2fcf063..4c63289 100644 --- a/insert.php +++ b/insert.php @@ -10,15 +10,13 @@ if ($conn->connect_error){ } var_dump($_POST['url']); -var_dump($_POST['author']); -if($_POST['url'] == '' && $_POST['author'] == ''){ +if($_POST['url'] == ''){ header('Location: /'); return; } - $url = $_POST['url']; -$author = $_POST['author']; +$author = $_SESSION['user']; $sql = "INSERT INTO cheaterliste (url, author) VALUES('".$url."', '".$author."')"; $conn->query($sql); diff --git a/login.php b/login.php index 3de739a..9928c5c 100644 --- a/login.php +++ b/login.php @@ -15,6 +15,10 @@ if ($result->num_rows == 1) { $_SESSION['id'] = $result->fetch_array()['id']; + unset ($_SESSION['status']); + $_SESSION['user'] = $_POST['user']; + } else { + $_SESSION['status'] = '

Benutzername oder Kennwort ist falsch

'; } header('Location: /'); ?> diff --git a/style.css b/style.css index 2a7dea7..f5734ba 100644 --- a/style.css +++ b/style.css @@ -50,15 +50,15 @@ table.center { margin-top: 200px; } -.form { - max-width: 360px; - margin: 0 auto; +.loginform { + max-width: 340px; + margin-left: auto; padding: 30px; padding-bottom: 0px; background: rgba(18,18,18, 0.3); border: 2px solid #DDDDDD; } -.form input { +.loginform input { width: 100%; margin: 0 0 15px; box-sizing: border-box; @@ -68,6 +68,6 @@ table.center { color: #000000; background-color: white; } -.form button:hover,.form button:active,.form button:focus { +.loginform button:hover,.loginform button:active,.loginform button:focus { background: #43A047; }