Miscellany
public text v1 · immutable//on test.php (for the form)
<?php
if(isset($_POST['submit']))
include 'ajax.php';
?>
//on ajax.php
<?php
if($_SERVER['REQUEST_METHOD'] != 'POST' || !isset($_POST['submit']) || $_POST['submit'] != 'Submit'){
exit('Invalid page request!');
}
$File = "mypage.html";
$Handle = fopen($File, 'a');
$Data = $_POST['name'] . " - " . $_POST['myname'] . "<br>";
fwrite($Handle, $Data);
fclose($Handle);
$return = "Added";
echo $return;
?>