Here's the form:
<form>
<form action="" method="post">
<input type="text" id="name" name="name" placeholder="Name">
<input type="text" id="message" name="message"
placeholder="Grateful for?">
<br>
<br>
<input type=submit value="❦">
<input type="reset" value="✖">
</form>
Here's the code:
<?php
if(isset($_POST['submit'])){
$Name = $_POST['name'];
$Message = $_POST['message'];
$file = fopen("post.txt", "a");
fwrite($file, $Name, $Message);
fclose($file);
}
?>
Form is asking for input of a 'name' and a short 'message', those values should be available with PHP $_POST superglobal. Is my syntax correct with the "$Name" or "Message" variable associated with the $_POST variable?
The $file variable looks correctly set to my post.txt and am I writing out correct syntax for fwrite and fclose?