Hi,
ich habe Probleme mit einem Script vielleicht könnter mir weiterhelfen
Warning: Cannot modify header information - headers already sent by (output started at /home/rmnt/test/main.php:7) in /home/rmnt/test/main.php on line 97
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/rmnt/test/main.php:7) in /home/rmnt/test/main.php on line 99
habe das Script @ home laufen lassen: WXP Apache 2.0.48 PHP 4.3.4
auf dem Server Redhat 9 gleicher apache gleies php... aber diese Fehlermeldung kommt
ich habe Probleme mit einem Script vielleicht könnter mir weiterhelfen
Warning: Cannot modify header information - headers already sent by (output started at /home/rmnt/test/main.php:7) in /home/rmnt/test/main.php on line 97
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/rmnt/test/main.php:7) in /home/rmnt/test/main.php on line 99
PHP-Code:
if(isset($_POST['name']) && ($_POST['pwd'])) {
$sql = "SELECT
ID,
name,
pwd,
email,
allianz,
ustatus
FROM
users
WHERE
name = '".$_POST['name']."'";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
if($row['ustatus'] == '0') {
echo "Du bist noch nicht freigeschaltet.";
echo "<meta http-equiv=\"refresh\" content=\"2; URL=main.php\">";
} else {
// PW mit DB abgleichen
if($row['pwd'] != md5($_POST['pwd'])) {
echo "<font class=\"warning\">Falsches Passwort</font>";
} else {
//session_start();
if(mysql_num_rows($result)) {
SetCookie("ID",$row['ID'],time()+365*24*3600,"/",$_SERVER['HTTP_HOST']);
SetCookie("name",$row['name'],time()+365*24*3600,"/",$_SERVER['HTTP_HOST']);
SetCookie("pwd",$row['pwd'],time()+365*24*3600,"/",$_SERVER['HTTP_HOST']);
SetCookie("allianz",$row['allianz'],time()+365*24*3600,"/",$_SERVER['HTTP_HOST']);
SetCookie("email",$row['email'],time()+365*24*3600,"/",$_SERVER['HTTP_HOST']);
SetCookie("ustatus",$row['ustatus'],time()+365*24*3600,"/",$_SERVER['HTTP_HOST']);
session_start();
$_SESSION['ID'] = $row['ID'];
$_SESSION['name'] = $row['name'];
$_SESSION['pwd'] = $row['wd'];
$_SESSION['allianz'] = $row['allianz'];
$_SESSION['email'] = $row['email'];
$_SESSION['ustatus'] = $row['ustatus'];
}
header("Location: main.php");
}
}
}
}
} else {
auf dem Server Redhat 9 gleicher apache gleies php... aber diese Fehlermeldung kommt
Kommentar