Diese Meldung wird allerdings in einem neuen Fenster ausgegeben, ich möchte diese aber über der Loginform ausgeben lassen (siehe rot markierten bereich auf Abbildung). Wäre nett, wenn sich jemand mal mein Script ansieht und mir da weiterhelfen kann.
Außerdem erhalte ich folgende Fehlermeldung bei meinem Script:
"Notice: Undefined index: action in C:\Xampp\Htdocs\fiestaarchive\index.php on line 14"
Code:
<?php define('access', true); $crapVarr = 'F@#&$^*FG^&F^#$&#&D$%%#$D%&$^%#&D#%&F$#'; include_once('includes/xinc.config.php'); include_once('lang/deDE.php'); $behave = 0; if(!isset($_SESSION["username"]) and !isset($_GET["action"])) { $behave = 0; } if ($_GET["action"] == "login") { $username = mysql_escape_string($_POST["username"]); $password = md5($_POST["password"]); $connect = mysql_connect ($_CONFIG["svr_host"], $_CONFIG["svr_user"], $_CONFIG["svr_pwd"]) or die ($_LANG['cn_error']); mysql_select_db ($_CONFIG["svr_db"]) or die ($_LANG['db_error']); $control = 0; $sql = "SELECT * FROM accounts WHERE BINARY username = '$username' AND password = '$password' AND ban = '0'"; $result = mysql_query($sql); while($row = mysql_fetch_object($result)) { $control++; } if($control != 0) { $_SESSION["username"] = $username; $behave = 1; } else { $behave = 2; } } ?> <!DOCTYPE html> <html lang="de-de"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="author" content="<?php echo $_CONFIG['cdts_author']; ?>"> <meta name="publisher" content="<?php echo $_CONFIG['cdts_publisher']; ?>"> <meta name="keywords" content="<?php echo $_CONFIG['allg_tags']; ?>"> <meta name="description" content="<?php echo $_CONFIG['allg_desc']; ?>"> <title><?php echo $_CONFIG['allg_name'];?></title> <link rel="shortcut icon" href="images/favicon.ico" type="image/ico"> <link rel="stylesheet" type="text/css" href="css/default.css"> <?php if($behave == 1) { ?> <meta http-equiv="refresh" content="0; URL=index.php?action=home"> <?php } ?> </head> <body> <?php if($behave == 0) { if(isset($_SESSION["username"])) { ?> <div class="nav">Du bist eingeloggt</div> <?php } else { ?> <div class="login"> <form method="post" action="index.php?action=login"> <label>Benutzername</label><br /> <input type="text" name="username" maxlength="20"><br /> <label>Kennwort</label><br /> <input type="password" name="password" maxlength="32"><br /> <input class="submit" type="submit" value="Anmelden"> </form> </div> <?php } } if($behave == 1) { echo 'Login erfolgreich!'; } if($behave == 2) { echo 'Login fehlgeschlagen!'; } ?> </body> </html> </body> </html>