Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php ob_start(); session_start(); ?>
- <html>
- <head>
- <title>Login</title>
- <link href="login.css" rel="stylesheet" type="text/css">
- </head>
- <!--
- <body>
- Werbungsabfänger
- </body>
- -->
- <body>
- <?php
- $host = "localhost";
- $user = "sportef";
- $pass = "65fci7ztf9";
- $dbname = "sportef";
- $db = new PDO("mysql:host=$host; dbname=$dbname", $user, $pass);
- if(isset($_POST['submit']))
- {
- //Variablen anlegen
- $username = $_POST['username'];
- $passwort = $_POST['passwort'];
- $checkOk = true;
- $fail = "Die eingegebene Benutzername/Password Kombination ist nicht korrekt.";
- $id = $db->query("SELECT `activateid` FROM `Benutzer` WHERE `Benutzername` = '$username'");
- $rows2 = $id->fetch();
- //Post Inhalte überprüfen
- if(empty($username))
- {
- $checkOk = false;
- echo "Bitte geben sie einen Benutzernamen ein.<br>";
- }
- if(empty($passwort))
- {
- $checkOk = false;
- echo "Bitte geben sie ein Passwort ein.<br>";
- }
- if($rows2['activateid'] != "")
- {
- $checkOk = false;
- echo "Bitte aktiviere deinen Acount.<br>";
- }
- //Wenn Post Inhalte keine Fehler enthalten
- if($checkOk)
- {
- $passwort = md5($passwort);
- $query = $db->query("SELECT `Benutzername`, `Passwort` FROM `Benutzer` WHERE `Benutzername`='$username' AND `Passwort`='$passwort' LIMIT 1");
- $nums = $query->rowCount();
- //Überprüfen
- if($nums > 0 && $username != "Klinger Volker" && $username != "MarvinAdmin")
- {
- $_SESSION['Benutzername'] = $username;
- Header("Location: daten.php");
- ob_end_flush();
- }
- elseif($nums <= 0)
- {
- echo $fail;
- }
- elseif($username = "Klinger Volker" || $username = "MarvinAdmin" )
- {
- $_SESSION['Benutzername'] = $username;
- Header("Location: datenadmin.php");
- ob_end_flush();
- }
- }
- else
- {
- echo " ";
- }
- }
- ?>
- <form method='POST'>
- <h1>Stiftisches Gymnasium <br>Sport EF/10</h1>
- <span style="color: #40ffff">Benutzername:</span><br>
- <input type='text' name='username'><br><br>
- <span style="color: #40ffff">Passwort:</span><br>
- <input type='password' name='passwort'><br><br>
- <input type='submit' value='Login' name='submit'><br><br><br><br><br>
- </form>
- <big><small>Wenn Ihr noch nicht registriert seid, könnt Ihr das <a href="registrierung.php">hier</a> tun.</small></big>
- <div id="footer">
- <hr>
- 2012 © Marvin Wirtz || <a href="impressum.php">Impressum</a>
- </div>
- </body>
- </html>
- body{
- background-color: #808080;
- background:url(Untitled-1.jpg);
- color: #40ffff;
- font-size: 40px;
- text-align: center;
- font-family: Georgia,
- }
- table { background: transparent; }
- form{
- font-size: 35px;
- text-align: center;
- }
- input{
- color:#000000;
- font-size: 35px;
- text-align: center;
- }
- h1{
- color:#40ffff;
- font-size:50px;
- }
- big{
- color:#40ffff;
- }
- span{
- color:#40ffff;
- }
- a{
- color:#40ffff;
- }
- html, body {
- margin:0;
- padding:0;
- height:100%;
- overflow:hidden;
- }
- #footer {
- position:fixed;
- bottom:0px;
- text-align:center;
- padding:10px;
- width:100%;
- font-size:18px;
- }
Add Comment
Please, Sign In to add comment