//Change the name of the textfile to whatever you need to. Put it in the same folder as this file.
$ourFileName = "textfile.txt";
$fh = fopen($ourFileName, 'a') or die("Can't open file");
...copy and save that as whatever.php, and create a blank text document and save it as textfile.txt. Upload them both to the same folder on your webserver, and chmod textfile.txt to 777.