検索テキストボックスを含む「header.php」ファイルがあります。「myPage.php」という別のファイルには、「header.php」が含まれています。header.php 内
if (isset($_POST['Searchbutton'])){ // this will execute when the search button is clicked.
$target = $_POST['searchtext'];
header("Location: searchresult.php?text=" . $target); // line #8
}
myPage.php 内
<?php
include("header.php");
?>
「myPage.php」で検索オプションを使用すると、次のエラーが表示されます
Cannot modify header information - headers already sent by (output started at myPage.php:3) in header.php on line 8.
誰でもコンセプトを理解するのを手伝ってくれませんか。私はphpの初心者です。さらに情報が必要かどうか尋ねてください。
乾杯!