proWoke
Новичок
Не возвращает в хтмл форму
<html>
<head>
<title>php</title>
</head>
<body>
<?
$filename = "textform.txt";
if (file_exists($filename)) {
$file = fopen($finlename, "a");
} else { $file = fopen ($filename, "w");
}
$text = $_POST['text'];
$textarea = str_replace("\r\n", " ",
$_POST['textarea'])."\r\n";
$result = $text."=".$textarea;
fwrite($file, $result);
fclose($file);
header("Location: htmlform.html");
?>
</body>
</html>
пишет: Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\phpform.php:6) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\phpform.php on line 18
Сам по себе скрипт работает и делает то, что надо. Но он должен возвращать в хтмл файл, а он этого почему то не делает. Те header должен возвращать, как я понимаю, а он чёто фиг. В чём ошибка?
н
<html>
<head>
<title>php</title>
</head>
<body>
<?
$filename = "textform.txt";
if (file_exists($filename)) {
$file = fopen($finlename, "a");
} else { $file = fopen ($filename, "w");
}
$text = $_POST['text'];
$textarea = str_replace("\r\n", " ",
$_POST['textarea'])."\r\n";
$result = $text."=".$textarea;
fwrite($file, $result);
fclose($file);
header("Location: htmlform.html");
?>
</body>
</html>
пишет: Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\phpform.php:6) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\phpform.php on line 18
Сам по себе скрипт работает и делает то, что надо. Но он должен возвращать в хтмл файл, а он этого почему то не делает. Те header должен возвращать, как я понимаю, а он чёто фиг. В чём ошибка?
н