You’d need to host your program.php in a server that runs PHP.
Then the directory/file should have write access priveleges.
And more importantly, saving unfiltered user input to your server without doing a lot of sanitizing/checking is so insecure, especially saving the user input directly into a php file on a server — this is just a vector for your server being hacked.
To answer your question,
$txt = $_POST['text']; // it should be the name of your form variable
// given this code
// <input type="text" name="channel0Title" value="Channel 7">
// it should be
$txt = $_POST['channel0Title'];