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? any ideas on how to fix this?