Hiya!
Thank you very much for responding!
I am not quite sure what you mean by what part of the game this is, but I will try my best to answer.
This basically links everything together to form a game page. It calls the right PHP file with the right variables, retrieves the output from the PHP file, and sets the output to a variable. It then creates an instance of template.php which the variables of $title and $body, which template.php then puts in the appropriate places.
I pretty much have the basics all planned but this issue was really bugging me. I suppose just putting a couple of simple countermeasures like you suggested should be enough to keep the average casual hacker away.
If you are interested in learning how I worked this in more detail please feel free to ask.
Once again thanks for your help!