stimmt der code...das wichtigste
hier ist er:
<?php
session_start();
?>
<?php
if($_COOKIE['eingeloggt'] == true)
{
setcookie("eingeloggt","true", time()+1800);
unset($_SESSION['true']);
}
if($_SESSION['true'] == true)
{
setcookie("eingeloggt","true", time()+1800);
unset($_SESSION['true']);
}
if($_SESSION['false'] == false)
{
setcookie("false","false", time()+10);
unset($_SESSION['false']);
}
include('Layout-Start.htm');
$mysqlhost="localhost"; // Servername
$mysqluser="DrFerrerosql1"; // MySQL-Benutzer
$mysqlpwd="***"; // Passwort
$db="test"; //datenbankname
if (!$con=mysql_connect($mysqlhost, $mysqluser, $mysqlpwd))
{
die("Verbindung konnte nicht hergestellt werden.........." . mysql_error());
mysql_select_db($db, $con);
}
//-----------------------------------^oberes ist immer gleich^-----------------------------------
if(!$_COOKIE['eingeloggt'])
{
echo
"
<html>
<head>
<style type=\"text/css\">
.auto-style8 {
vertical-align: middle;
}
.auto-style9 {
font-size: xx-large;
font-family: Impact, Haettenschweiler, \"Arial Narrow Bold\", sans-serif;
}
.auto-style10 {
text-align: center;
}
</style>
</head>
<body>
<div id=\"Regi1\" style=\"position: absolute; width: 200px; height: 50px; z-index: 5; left: 1410px; top: 625px\">
<img height=\"50\" src=\"HP-Images/regi.png\" width=\"200\" class=\"auto-style8\">
</div>
<div id=\"Login1\" style=\"position: absolute; width: 420px; height: 600px; z-index: 4; left: 1300px; top: 300px;\" class=\"auto-style8\">
<img height=\"600\" src=\"HP-Images/BG-Login.png\" width=\"420\">
<div id=\"Ebene1\" style=\"position: absolute; width: 320px; height: 220px; z-index: 1; left: 50px; top: 50px\" class=\"auto-style10\">
<div class=\"auto-style10\">
<span class=\"auto-style9\"><strong>Login</strong></span><br>
</div>
<form method=\"post\">
<div class=\"auto-style10\">
<label id=\"Label1\"></label>
<input name=\"Username_Input\" style=\"width: 200px\" type=\"text\" value=\"Dein Username\"></div>
</form>
<form method=\"post\">
<div class=\"auto-style10\">
<input name=\"Passwort_Input\" type=\"password\" value=\"Dein Passwort\" style=\"width: 200px\"></div>
</form>
<form method=\"post\">
<div class=\"auto-style10\">
<input name=\"Login_Button\" style=\"width: 100px; height: 30px\" type=\"submit\" value=\"Einloggen\">
</div>
</form>
</div>
</div>
</div>
</div>
</body>
</html>
";
}
$Username = $_POST['Username_Input'];
$Passwort = md5($_POST['Passwort_Input']);
$Username_DB = mysql_query("SELECT Nickname FROM ControlPanel");
$Passwort_DB = mysql_query("SELECT Passwort FROM ControlPanel WHERE 'Nickname == $Username'");
if(isset($_POST['Login_Button']))
{
if(isset($Username) AND isset($Passwort))
{
if($Passwort == $Passwort_DB AND $Username == $Username_DB)
{
$_SESSION['true'] = "true";
$_SESSION['Username'] = $Username;
$_SESSION['Passwort'] = $Passwort;
echo "<meta http-equiv=\"refresh\" content=\"0\" URL=\"index.php\">";
}
else
{
$_SESSION['false'] = "false";
echo "<meta http-equiv=\"refresh\" content=\"0\" URL=\"index.php\">";
}
}
if(!isset($Username) AND !isset($Passwort))
{
$_SESSION['false'] = "false";
echo "<meta http-equiv=\"refresh\" content=\"0\" URL=\"index.php\">";
}
}
if($_COOKIE['eingeloggt'] == true)
{
$UsernameAngemeldet = $_SESSION['Username'];
$Rangname = array("NormalUser","Moderator","Kon-Administrator","Administrator");
$Gruppenrang_DB = mysql_query("SELECT GruppenID FROM ControlPanel WHERE 'Nickname == $Username' ,'Passwort == $Passwort'");
$Kontostand = mysql("SELECT Kontostand FROM ControlPanel WHERE 'Nickname == $Username' ,'Passwort == $Passwort'");
echo"
<html>
<head>
<style type=\"text/css\">
.auto-style11 {
vertical-align: middle;
}
.auto-style12 {
text-align: center;
}
.auto-style13 {
font-family: Impact, Haettenschweiler, \"Arial Narrow Bold\", sans-serif;
font-size: medium;
}
.auto-style14 {
font-family: Impact, Haettenschweiler, \"Arial Narrow Bold\", sans-serif;
font-size: small;
}
.auto-style15 {
font-family: Impact, Haettenschweiler, \"Arial Narrow Bold\", sans-serif;
}
.auto-style16 {
font-size: small;
}
.auto-style17 {
color: #FF0000;
font-size: medium;
}
</style>
</head>
<body>
<div id=\"CP1\" style=\"position: absolute; width: 200px; height: 50px; z-index: 5; left: 1410px; top: 625px\">
<img class=\"auto-style11\" height=\"50\" src=\"HP-Images/CP.png\" width=\"200\"></div>
<div id=\"TS1\" style=\"position: absolute; width: 200px; height: 50px; z-index: 5; left: 1410px; top: 700px\">
<img height=\"50\" src=\"HP-Images/TS.png\" width=\"200\" class=\"auto-style11\">
</div>
<div id=\"Login1\" style=\"position: absolute; width: 420px; height: 600px; z-index: 4; left: 1300px; top: 300px;\" class=\"auto-style11\">
<div id=\"Ebene1\" style=\"position: absolute; width: 320px; height: 220px; z-index: 1; left: 50px; top: 50px\" class=\"auto-style12\">
<span class=\"auto-style13\">Hallo ".$UsernameAngemeldet.",<br></span>
<span class=\"auto-style15\"><br class=\"auto-style16\"></span>
<span class=\"auto-style13\"><span class=\"auto-style14\">du hast dich als
Benutzer mit dem Rang<br>".$Rangname[$Gruppenrang_DB]." eingeloggt</span></span><br class=\"auto-style14\">
<br class=\"auto-style14\"><span class=\"auto-style14\">Kontostand:
".$Kontostand." €<br><br>Kontoaufladen<br>Finanzübersicht<br><br>Ausloggen<br></span>";
/*if()
$Bestätigungsmail = "Du musst deinen Account erst per E-Mail bestätigen";
{
echo"
<br>
<span class=\"auto-style15\"><span class=\"auto-style17\">
!".$Bestätigungsmail."!</span></span>";
}*/
echo
"
</div>
<img height=\"600\" src=\"HP-Images/BG-Login.png\" width=\"420\">
</div>
</body>
</html>
";
}
if($_COOKIE['false'] == false)
{
echo
"
<html>
<head>
<style type=\"text/css\">
.auto-style18 {
vertical-align: middle;
}
.auto-style19 {
font-size: xx-large;
font-family: Impact, Haettenschweiler, \"Arial Narrow Bold\", sans-serif;
}
.auto-style20 {
text-align: center;
}
.auto-style21 {
color: #FF0000;
font-size: medium;
}
</style>
</head>
<body>
<div id=\"Regi1\" style=\"position: absolute; width: 200px; height: 50px; z-index: 5; left: 1410px; top: 625px\">
<img height=\"50\" src=\"HP-Images/regi.png\" width=\"200\" class=\"auto-style18\">
</div>
<div id=\"Login1\" style=\"position: absolute; width: 420px; height: 600px; z-index: 4; left: 1300px; top: 300px;\" class=\"auto-style18\">
<img height=\"600\" src=\"HP-Images/BG-Login.png\" width=\"420\">
<div id=\"Ebene1\" style=\"position: absolute; width: 320px; height: 220px; z-index: 1; left: 50px; top: 50px\" class=\"auto-style20\">
<div class=\"auto-style20\">
<span class=\"auto-style19\"><strong>Login</strong></span><br>
</div>
<form method=\"post\">
<div class=\"auto-style20\">
<label id=\"Label1\"></label>
<input name=\"Username_Input\" style=\"width: 200px\" type=\"text\" value=\"Dein Username\"></div>
</form>
<form method=\"post\">
<div class=\"auto-style20\">
<input name=\"Passwort_Input\" type=\"password\" value=\"Dein Passwort\" style=\"width: 200px\"></div>
</form>
<form method=\"post\">
<div class=\"auto-style20\">
<input name=\"Login_Button\" style=\"width: 100px; height: 30px\" type=\"submit\" value=\"Einloggen\">
</div>
</form>
<br></br>
<span class=\"auto-style21\"><br>*Login fehlgeschlagen. Benutzername und Passwort falsch</br></span>
</div>
</div>
</div>
</div>
</body>
</html>
";
}
?>
Alles anzeigen
/e: bei mir ist das problem wenn der login nicht geht dann soll eine nachricht kommen mit pw oder username falsch aber das kommt immer
//e2: rechtschreibfehler