Write data from text box to a text file
<p>I have developed a text box and I am trying to write this data to a text file.
The PHP code is generating the file but the data is not being written.
below is my code: </p>

<pre><code>&lt;html&gt;
&lt;body&gt;
&lt;form name="form" method="post"&gt;
&lt;input type="text" name="text_box" size="50"/&gt;
&lt;input type="submit" id="search-submit" value="submit" /&gt;
&lt;?
$a=@$_POST["text_box"];
$myFile = "t.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh,$a);
fclose($fh);
?&gt;
</code></pre>

<p>
   </p>
