I am trying to create a script that edits my .htpasswd file when a user creates a new account. Here is the code:
<?php
$fp = fopen ("path to script\.htpasswd", "a+") or die("Cannot Open File");
fwrite ($fp, "$username:$password\n") or die("Cannot Edit File");
fclose($fp);
?>
The problem with this script is that instead of going to the next line (like \n ussually does) it creates a little box instead? I'm running the server on windows xp, server is apache. I posted this a few days ago and was suggested to use Textpad, however, this doesn't help when i'm trying to edit from within a php script. any ideas on how to fix this so that it send me to the next line in the .htpasswd file instead of creating a box?