警告:ヘッダー情報を変更できません - ヘッダーは既に送信されています(出力は...行14を開始しました)。これは通常、header()メソッドの前のecho文が原因ですが、header()自体の前にエコーが呼び出されることはありません。出力がどこで発生しているのか、なぜ現在は困っているのか、さらにこれを修正できるのかどうか教えてください。高度でヘッダー情報を変更できません - バッフル
<p>Lorem ipsum...</p>
おかげで、
最大:
ライン14は、コンテンツのdiv内の行です。
<html>
<head>
<title></title>
<!-- CSS -->
<link ... />
</head>
<body class="index not-admin">
<div id="wrapper">
<div id="logo"></div>
<div id="headerInvoice">
</div>
<div id="content">
<form name="signup" action="" method="GET">
<input name="email" type="email" placeholder="Email Address" />
<input type="submit" title="Submit!"/>
</form>
<?php
if($_SERVER['REQUEST_URI'] == '/betas/') {
header('Location:http://betas.maxk.me');
}
if (isset($_GET['email'])) {
$email = $_GET['email'];
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$error = 'Email Address is invalid.';
}
else {
mysql_connect('localhost', '...', '...');
mysql_select_db('...');
$email = mysql_real_escape_string($email);
if (mysql_num_rows(mysql_query("SELECT * FROM testers WHERE `email_address` = '$email'")) < 1) {
mysql_query("INSERT INTO `testers` (`email_address`,`accepted`) VALUES ('$email','0')");
$error = !mysql_error()? 'Success!' : "We came across an error, please try again! " . mysql_error();
}
else {
$error = 'Sorry, but you have already signed up! Please try emailing me to see if I need any testers through my <a href="http://maxk.me">homepage</a>.';
}
}
echo $error;
}
?>
<br />
<a href="#">Login</a>
</div>
<div id="footer">
</div>
</div>
</body>
</html>
あなたは最初の '<?php'タグを閉じていないことは知っていますか? – steveoh