I
incendium
Guest
Hi @ all,
ich hoffe jemand kann mir helfen. Ich will mir gerade einen Login bauen. Wenn ein User das Passwort falsch eingibt, soll er nur begrenzt Versuche haben. Es will aber das Cookie nicht setzen. Fehler:
CODE:
mfg
ich hoffe jemand kann mir helfen. Ich will mir gerade einen Login bauen. Wenn ein User das Passwort falsch eingibt, soll er nur begrenzt Versuche haben. Es will aber das Cookie nicht setzen. Fehler:
Wie kann ich das beheben?Warning: Cannot modify header information - headers already sent by (output started at /users/(old user)/www/cms/devon/admin.php:16) in /users/(old user)/www/cms/devon/admin.php on line 54
CODE:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Administrator-Login</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="admin.css">
</head>
<body>
<div class="wrap">
<div class="top"></div>
<div class="main">
<?php
if(!isset($_POST['aktion'])){
echo"
<form action='' method='post'>
<table class='login'>
<tr>
<th>
Benutzername:
</th>
<th>
<input type='text' name='benutzername'>
</th>
</tr>
<tr>
<th>
Passwort:
</th>
<th>
<input type='password' name='password'>
</th>
</tr>
</table>
<input type='submit' value='Login' name='aktion' style='margin-top:5px;'>
</form>
";
}
else{
if(($_POST['benutzername'] == "admin") AND ($_POST['password'] == "test")){
echo"Eingeloggt";
}
else{
if(!isset($_COOKIE['Versuche'])){
$versuche = 5;
$Gueltigkeit = time()+6000;
setcookie("Versuche", $versuche, $Gueltigkeit);
}
else{
$versuche = $_COOKIE['Versuche'] - 1;
$Gueltigkeit = time()+6000;
setcookie("Versuche", $versuche, $Gueltigkeit);
}
echo"Ihre Eingaben waren nicht korrekt!<br>";
echo"Sie haben noch ".$versuche." Versuche.";
echo"<form action='' method='post'><input type='submit' name='clear' value='Nochmals versuchen!'></form>";
}
}
?>
</div>
<div class="footer"></div>
<div class="copyright">© 2008 by Devon</div>
</div>
</body>
</html>
Zuletzt bearbeitet von einem Moderator: