Just like to add (cause I had to find this out on my own) if you do decide to run php script in your template files, you have to execute it differantly (see below:)
Run raw code:
<!-- PHP -->
<!-- ENDPHP -->
You may also include PHP from an external file using:
(If you do this it looks for the file in your phpbb root folder, (www.mysite.com/phpbb3/
) for example tried to do a path and it didn't work.
<!-- INCLUDEPHP somefile.php -->