Also ich hab hier folgendes gecodet.
login.php
<?php
include "config.inc.php";
include "connect.inc.php";
$einbauen = "SELECT * FROM mxcrew WHERE nickname ='$nickname'";
$ergebnis = mysql_query($einbauen);
while($row = mysql_fetch_object($ergebnis)) {
if ($password == $row->password) {
setcookie("nickname",$nickname,time()+36000);
setcookie("password",$password,time()+36000);
header('Location:index.php');
}
elseif ($row->password != $password) {
echo 'Passwort falsch';
}
}
?>
logout.php
<?php
setcookie("nickname",$nickname,time()-4);
setcookie("password",$password,time()-4);
header('Location:index.php');
?>
wenn ich mich dann einlogge oder auslogge kommt immer folgender fehler.
Warning: Cannot add header information - headers already sent by (output started at /www/htdocs/v030897/page/index.php:151) in /www/htdocs/v030897/page/temp/login.php on line 8
Warning: Cannot add header information - headers already sent by (output started at /www/htdocs/v030897/page/index.php:151) in /www/htdocs/v030897/page/temp/login.php on line 9
nur ich versteh da absolut gar nix
login.php
<?php
include "config.inc.php";
include "connect.inc.php";
$einbauen = "SELECT * FROM mxcrew WHERE nickname ='$nickname'";
$ergebnis = mysql_query($einbauen);
while($row = mysql_fetch_object($ergebnis)) {
if ($password == $row->password) {
setcookie("nickname",$nickname,time()+36000);
setcookie("password",$password,time()+36000);
header('Location:index.php');
}
elseif ($row->password != $password) {
echo 'Passwort falsch';
}
}
?>
logout.php
<?php
setcookie("nickname",$nickname,time()-4);
setcookie("password",$password,time()-4);
header('Location:index.php');
?>
wenn ich mich dann einlogge oder auslogge kommt immer folgender fehler.
Warning: Cannot add header information - headers already sent by (output started at /www/htdocs/v030897/page/index.php:151) in /www/htdocs/v030897/page/temp/login.php on line 8
Warning: Cannot add header information - headers already sent by (output started at /www/htdocs/v030897/page/index.php:151) in /www/htdocs/v030897/page/temp/login.php on line 9
nur ich versteh da absolut gar nix