Hello
I am trying to learn php, I have been looking up information on google, I understand a few things but i need help, I want to get input form an html form and save it to a text file here a snippet of some code I have tried:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"/>
<title>Test</title>
</head>
<body>
<form enctype="text/plain" method="POST" name="TestForm"/>
<p />
Input anything: <input type="text" name="anything" value="Default"/> <br />
<input type="submit" value="OK" name="submit"/>
</form>
<?php
if ($submit=='OK') {
$fh = fopen("form_output.txt", 'w');
fwrite($fh, $_POST['anything']);
fclose($fh);
}
?>
</body>
</html>
it shows the form but the output text file is not created I am running php5 on linux.
TIA