I am using PHP and fwrite code, but I want every write position to start from the beginning of the file without erasing it\'s content. I am using this code but it is writing
This should work:
$file="name.extension";
$current = file_get_contents($file);
$user = $_POST["username"];
$pass = $_POST["password"];
file_put_contents($file,$current . "Whatever you want to add here"
This finds the current stuff and copy/pastes it back each time the code is ran (tried to make it as simple as possible in case other answers are a little too complicated)