just create an addons the name you want and enable it
create files called: external_php_code.php
Code:
<?php
$addon_version = "0.0.1";
$addon_name= "EXTERNAL_PHP_CODE";
$addon_description = '<"EXTERNAL_PHP_CODE>';
$external_php_code = '';
$external_php_code .= 'your code here';
$tpl = ereg_replace("<EXTERNAL_PHP_CODE>",$external_php_code,$tpl);
?>