Hallo Community,
Ich hab ein Problem das ich selber nicht beheben kann.
Hier sind die Fehler:
Browser Auszug
PHP
real_escape_string($_POST['username']); $Password = $db->real_escape_string($_POST['password']); $CheckAcc = $db->query("SELECT id FROM users WHERE username = '$Username' AND password = '$Password' LIMIT 1"); if($db->num_rows($CheckAcc)) { $_SESSION['username'] = $Username; header("Location: index.php"); } else { echo 'Die angegebenen Benutzerdaten, scheinen nicht korrekt zu sein!'; } } ?>
NetBeans Editor Auszug
PHP
<?phpif(isset($_SESSION['username'])) { header("Location: index.php?page=home"); }session_start();if(isset($_POST['submit'])){ $Username = $db->real_escape_string($_POST['username']); $Password = $db->real_escape_string($_POST['password']); $CheckAcc = $db->query("SELECT id FROM users WHERE username = '$Username' AND password = '$Password' LIMIT 1"); if($db->num_rows($CheckAcc)) { $_SESSION['username'] = $Username; header("Location: index.php"); } else { echo 'Die angegebenen Benutzerdaten, scheinen nicht korrekt zu sein!'; }}?><html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title> {$title_Firm} - Login</title> <!-- Bootstrap core CSS --> <link href="{$system_style}css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="{$system_style}css/signin.css" rel="stylesheet"> <!-- Just for debugging purposes. Don't actually copy these 2 lines! --> <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]--> <script src="{$system_style}js/ie-emulation-modes-warning.js"></script> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <form class="form-signin" role="form" method="post"> <h2 class="form-signin-heading">Bitte Einloggen</h2> <label for="inputtext" class="sr-only">Benutzername</label> <input type="text" id="inputEmail" class="form-control" placeholder="Benutzername" name="username" autofocus> <br> <label for="inputpassword" class="sr-only">Passwort</label> <input type="password" id="inputPassword" class="form-control" placeholder="Passwort" name="password"> <div class="checkbox"> <label> Noch nicht Registriert,dann <a href="register.php">hier</a> entlang. </label> </div> <button class="btn btn-lg btn-primary btn-block" type="submit" name="submit">Login</button> </form> </div> <!-- /container --> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <script src="{$system_style}js/ie10-viewport-bug-workaround.js"></script> </body></html>
bitte nicht wunder wenn ich es so gemacht hab da ich es selbst nicht gefunden hab um es um zuschreiben.
musste ich auf die alt bekannte Methode zurück greife Copy&Paste.
MFG
DarkEvolution