I hate to ask for help for my first, but I am currently having issues writing out a code for a program in progress. Basically, I am not great at php, but I need a code that will store information when sent to it from the program itself. I am setting it up to store login information, so the program writes out (lets say the username), when the person clicks the 'Next' button, it sends it to the .php and the .php will write that certain file out with the username as the .txt file name. I have this so far, if someone could figure out the code, that would be amazing. Thanks!
<?php
$msg = $_GET['w'];
$logfile= (['username.txt');
$fp = fopen($logfile, "a");
fwrite($fp, $msg);
fclose($fp);
?>