PHP Write to file not writing to file
<p>I want my php file to write some text to a text file that I have created but nothing is being written to it.</p>

<p>Here is the code:</p>

<pre><code>&lt;?php

error_reporting(E_ALL);
ini_set('display_errors', '1');

if (isset($_POST['comment'])) {
$comment = $_POST['comment'];

$myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $comment;
fwrite($fh, $stringData);
fclose($fh);

} else {
$comment = 'no comment';

$myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $comment;
fwrite($fh, $stringData);
fclose($fh);

}

?&gt;
</code></pre>
