4
1
Fork 0

Damals war alles besser!

This commit is contained in:
MaKe_Univ3rs 2017-04-01 00:54:08 +02:00
parent 96d917377f
commit d2a5026d14
5 changed files with 51 additions and 8 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

View file

@ -1,15 +1,30 @@
<head>
<title>MARC KANN NICHTS! Cheaterliste</title>
<title>Cheaterliste</title>
<link href="style.css?v=<?php date("YmdHis");?>" rel="stylesheet" type="text/css">
</head>
<?php
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;
}
$cockDatabase = "dulow";
$host = "localhost";
$user = "root";
$password = "";
$conn = new mysqli($host,$user,$password,$cockDatabase);
if ($conn->connect_error){
if($conn->connect_error){
die("Verbindung fehlgeschlagen: " . $conn->connect_error);
}
?>
@ -17,7 +32,6 @@ if ($conn->connect_error){
<table style="width:50%" class="center">
<tr>
<th style="padding: 0.5em 0.5em">Eintrag</th>
<!-- <th style="padding: 0.5em 0.5em">Avatar</th> -->
<th class="profil">Steam-Profil</th>
<th style="padding: 0.4em">Ersteller</th>
<th style="padding: 0.4em" class="Zeit">Erstelldatum</th>
@ -70,7 +84,9 @@ $number++;
Text:<input type="text" name="author"><br>
URL:<input type="text" name="url"><br>
<input type="submit" value="Hinzufügen">
</form>
<?php
?>

20
login.php Normal file
View file

@ -0,0 +1,20 @@
<?php
session_start();
$cockDatabase = "dulow";
$host = "localhost";
$user = "root";
$password = "";
$conn = new mysqli($host,$user,$password,$cockDatabase);
if($conn->connect_error){
die("Verbindung fehlgeschlagen: " . $conn->connect_error);
}
$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'];
}
header('Location: /');
?>

View file

@ -1,6 +1,7 @@
body {
background-size: cover;
background-image: url(bg.jpg);
font-family: 'Lato', sans-serif;
}
table, td, th {
@ -8,7 +9,7 @@ table, td, th {
}
td, th {
padding: 1px 15px;
font-family: 'Lato', Arial, sans-serif;
font-family: 'Lato', sans-serif;
}
table {
border-collapse: collapse;
@ -48,7 +49,6 @@ table.center {
margin-right: auto;
margin-top: 200px;
}
form {
margin-left: 50%;
margin-right: 50%;

7
test.php Normal file
View file

@ -0,0 +1,7 @@
<?php
// $variable = "cockinator";
// echo 'Die Variable lautet: ' . $variable . ' ♥ ';
$zahl1 = 1;
$zahl2 = '2';
echo $zahl1 . $zahl2 * '34.5' - '100';
?>