vitalka12
Новичок
Ошибка Cannot modify header information........
почему показывает ошибку:
Warning: Cannot modify header information - headers already sent by (output started at Z:\home\localhost\www\partner\login.php:16) in Z:\home\localhost\www\partner\login.php on line 33
Warning: Cannot modify header information - headers already sent by (output started at Z:\home\localhost\www\partner\login.php:16) in Z:\home\localhost\www\partner\login.php on line 65
И как исправить эту ошибку
почему показывает ошибку:
Warning: Cannot modify header information - headers already sent by (output started at Z:\home\localhost\www\partner\login.php:16) in Z:\home\localhost\www\partner\login.php on line 33
Warning: Cannot modify header information - headers already sent by (output started at Z:\home\localhost\www\partner\login.php:16) in Z:\home\localhost\www\partner\login.php on line 65
И как исправить эту ошибку
PHP:
<?php
include("include/config.php");
include("include/db.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="keywords" content="">
<meta name="description" content="">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title></title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width='690' border='0' align='center' bgcolor='#FFFFFF' class='myin_border' cellspacing='0' cellpadding='0' >
<? include("blocks/header.php"); ?>
<tr>
<td><table width="690" border="0"cellspacing="0" cellpadding="0" >
<tr>
<? include("blocks/lefttd.php"); ?>
<td width="507" valign="top">
<?php
if (isset($_POST['user'])) {$user = $_POST['user']; $_SESSION['user'] = $user;}
if (isset($_POST['passwd'])) {$passwd = md5($_POST['passwd']); $_SESSION['passwd'] = $passwd; }
if (isset($_SESSION['user'])) {$user = $_SESSION['user'];}
if (isset($_SESSION['passwd'])) {$passwd = $_SESSION['passwd'];}
if (isset($_GET['action'])) {$action = $_GET['action'];}
if (isset($_POST['lostpasswd'])) {$lostpasswd = $_POST['lostpasswd'];}
if ($action == logout) {unset($_SESSION['user']); unset($_SESSION['passwd']); header("Location: index.php");}
if ($action == lostpassword) {
if (!isset($lostpasswd) or $captcha != $_SESSION['racaptcha']){
if ($captcha != $_SESSION['racaptcha'] and isset($lostpasswd)) {print "<p class='er_text'>Der Bestatigungscode war falsch.</p>";}
print "<form action='index.php?action=lostpassword' method='post'><p><label>Email-Adresse</label><br><input name='lostpasswd' type='text'><br><label>Bestatigungs-Code</label><br><img src='captcha.php' border='0'> <input class='captcha' name='captcha' type='text' size='2' maxlength='2'><p><input name='lost' type='submit' value='senden'></p></form>";
}else{
$result3 = mysql_query("SELECT mail FROM php_user WHERE mail='$lostpasswd'");
$myrow3 = mysql_num_rows($result3);
if ($myrow3 == 0){exit("<p>Die angegebene E-Mail-Adresse ist nicht registriert.</p>");
}else{
$result4 = mysql_query("SELECT user,passwd,mail FROM php_user WHERE mail='$lostpasswd'");
$myrow4 = mysql_fetch_array($result4);
mail("$myrow4[mail]", "Ihr Passwort $myrow4[user]", "login: $myrow4[user] Passwort: $myrow4[passwd]");
exit("</p>An die angegebene Email-Adresse wurde ihre passwort gesendet.</p>");
}
}
}
if (!isset($user) && !isset($passwd)) {
if (!isset($action)){
print "<form action='index.php' method='post'><p><label>Login</label><br><input name='user' type='text'><br><label>Passwort</label><br><input name='passwd' type='password'><br><a href='index.php?action=lostpassword'>Passwort vergessen?</a><br><a href='register.php'>Anmelden</a><p><input name='login' type='submit' value='login'></p></form>"; }
}else{
$result = mysql_query("SELECT user FROM php_user WHERE user='$user'");
$myrow = mysql_num_rows($result);
if ($myrow == 0) {
unset($_SESSION['user']); unset($_SESSION['passwd']);
exit("<p>Ungultiger Benutzername.</p>");
}
elseif ($myrow == 1) {
$result2 = mysql_query("SELECT user, passwd FROM php_user WHERE user='$user'");
$myrow2 = mysql_fetch_array($result2);
if ($user == $myrow2['user'] && $passwd == $myrow2['passwd']) {
header("location: index.php");
print "<p><a href='index.php?action=logout'>LogOut</a></p>";
}else{
unset($_SESSION['user']); unset($_SESSION['passwd']);
exit("</p>Falsches Passwort. <br><a href='index.php?action=lostpassword'>Passwort vergessen?</a></p>");
}
}
}
?>
</td>
</tr>
</table>
</td>
</tr>
<? include("blocks/footer.php"); ?>
</table>
</body>
</html>