Can anybody show me an example of how I can use an HTML form to change variables in a PHP file?
PHP form tutorial
As far as setting variables, you could also read/write a .ini style file, in which case you could use [man]parse_ini_file/man to read in the file or one of the user-contributed examples to write it back out.