I need to write some PHP that will pull testing stats out of an external database. That's no problem... But I notice that my PHP is getting converted when I try to post it in the forums. Can I write PHP scripts into the forums somehow or do I need to redirect it to a non-Moodle page?
You can't type PHP in user-space. Imagine the security risk! Just make your own Moodle script and link to it.