HTML フォームをテストしようとすると、白い画面が表示されます。これが私のコードです。
index.html
<form name="form1" method="post" action="test.php">
<textarea name="data" cols="100" rows="10">
Facebook:
Twitter:
Instagram:
Website:
Comments:
---------------------------------------------
</textarea>
<br>
<input type="submit" value="Save">
</form>
test.php
<html>
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 'On'); //On or Off
$saving = $_REQUEST['saving'];
if ($saving == 1){
$data = $_POST['data'];
$file = "data.txt";
$fp = fopen($file, "a") or die("Couldn't open $file for writing!");
fwrite($fp, $data) or die("Couldn't write values to file!");
fclose($fp);
echo "Saved to $file successfully!";
}
?>
</html>
ページで「ソースを表示」できますが、php ファイルで上記のコードを取得するだけです。ページのタイトルは test.php ページを表示しています。これを行う必要がありますか?PHP初心者です。前もって感謝します。