Put PHP variables to a text file
<p>I try to save some data in .txt file using script below. </p>

<pre><code>$name = $_POST['name'];
$email = $_POST['email'];
$username = $_POST['username'];
$password = $_POST['password'];



$filename = 'data.txt';

$data = "$name | $email | $username | $password\n";

    $handle = fopen($filename, 'w');
    fwrite($handle, $data);
    fclose($handle);
</code></pre>

<p>but as result it s put empty lines there. any hint?</p>
