How do I make this work?
<html> <head> <title>Page Title</title> </head> <body> <form action="myprocessingscript.php" method="POST"> <input name="field1" type="text" /> <input name="field2" type="text" /> <input type="submit" name="submit" value="Save Data"> </form> <?php $txt = "data.txt"; $fh = fopen($txt, 'w+'); if (isset($_POST['field1']) && isset($_POST['field2'])) { // check if both fields are set $txt=$_POST['field1'].' - '.$_POST['field2']; file_put_contents('data.txt',$txt."\n",FILE_APPEND); // log to data.txt fwrite($fh,$txt); // Write information to the file fclose($fh); // Close the file exit(); } ?> </body> </html>