
Код HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<form action="file.php" method="post">
<table align="center">
<tr>
<td align="right">Info</td>
<td><input type="text" name="info" /></td>
</tr>
<tr>
<td align="right" ><input type="submit" name="submit" value="Go" >
</td>
</tr>
<tr>
</tr>
</table>
</form>
</body>
</html>

PHP код:
<?php $info = $_POST['info'];
$fp = fopen('data.txt','a+') or die('Can\'t open file.');
flock($fp,LOCK_EX); fwrite($fp,$info) or die('Can\'t write to file.');
flock($fp,LOCK_UN);
echo 'Ready<br /><a href="javascript:history.back()">Back</a>';
fclose($fp);
?>