Hallo,
ich habe folgendes Login Script mir gebastelt, das mit Sessions arbeiten soll.
Wenn ich mich einlogge, dann bekomme ich aber immer folgende Feher:
Warning: Cannot add header information - headers already sent by (output started at /is/htdocs/29704/www.xxxxxxx/xxxxxx/login.php4:2) in /is/htdocs/29704/www.xxxxxxx/xxxxxx/login.php on line 13
Warning: Cannot add header information - headers already sent by (output started at /is/htdocs/29704/www.xxxxxxx/xxxxxx/login.php4:2) in /is/htdocs/29704/www.xxxxxxx/xxxxxx/login.php on line 14
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /is/htdocs/29704/www.xxxxxxx/xxxxxx/login.php on line 21
Das Script ist das folgende:
Ich weiss nicht mehr wo ich suchen soll.
Bitte um mithilfe
Danke vorab
mfg leinad
ich habe folgendes Login Script mir gebastelt, das mit Sessions arbeiten soll.
Wenn ich mich einlogge, dann bekomme ich aber immer folgende Feher:
Warning: Cannot add header information - headers already sent by (output started at /is/htdocs/29704/www.xxxxxxx/xxxxxx/login.php4:2) in /is/htdocs/29704/www.xxxxxxx/xxxxxx/login.php on line 13
Warning: Cannot add header information - headers already sent by (output started at /is/htdocs/29704/www.xxxxxxx/xxxxxx/login.php4:2) in /is/htdocs/29704/www.xxxxxxx/xxxxxx/login.php on line 14
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /is/htdocs/29704/www.xxxxxxx/xxxxxx/login.php on line 21
Das Script ist das folgende:
PHP-Code:
<?
require("settings.php");
if ($REQUEST_METHOD == "POST")
{
$md5passwort = md5($passwort.$secret);
if ($truecookie == "True") {
setcookie("loginuser", $user, time()+(30 * 24 * 3600),"/",".xxxxxx");
setcookie("loginpass", $passwort, time()+(30 * 24 * 3600),"/",".xxxxxx");
} else {
setcookie("loginuser", "", time()-(30 * 24 * 3600));
setcookie("loginpass", "", time()-(30 * 24 * 3600));
}
$serverid = mysql_connect ($dbhost, $dbuser, $dbpass);
mysql_select_db ($dbname);
$sqlbefehl = "SELECT * FROM _members where name='".$user."' and passwort='".$md5passwort."' and aktiv='checked'";
$ergebnis = mysql_query($sqlbefehl, $serverid);
while ($spalte = mysql_fetch_array ($ergebnis)) {
session_start();
session_register("loggedin");
session_register("user");
session_register("isadmin");
$loggedin = "youmakeit";
if ($spalte[15] == "checked") {
$isadmin = "true";
}
echo "<script language='Javascript'>location.href='index.php'</script>";
}
mysql_close ($serverid);
}
require("../head.php");
?>
<form method="post" action="<?=$SCRIPT_NAME; ?>" name="loginform">
<table align="center" height="98%" border="0" cellspacing="0" cellpadding="0"><tr><td>
<table align="center" border="0" cellspacing="5" cellpadding="5" bgcolor="<?= $tblcolor1 ?>">
<tr>
<td><font size="2"><b>Username : </b></font></td>
<td><input type="text" name="user" value="<?= $loginuser ?>"></td>
</tr>
<tr>
<td><font size="2"><b>Password : </b></font></td>
<td><input type="password" name="passwort" value="<?= $loginpass ?>"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="checkbox" name="truecookie" value="True" <? if (isset($HTTP_COOKIE_VARS['loginuser'])) { ?>checked<? } ?>><font size="2"><b>Setze Cookie für 30 Tage</b></font></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Login" name="submit"></td>
</tr>
</table>
</td></tr></table>
</form>
<script language="Javascript">
document.loginform.user.focus();
</script>
Bitte um mithilfe
Danke vorab
mfg leinad
Kommentar