As I said before, you need to output your output to a variable. you cannot echo it. You output it into a variable and then register it for use in the template. You are using echo in your php page. ie.....
not:
PHP Code:
echo "<a href=\"/mp3/$file\">$file</a><br />";
but:
PHP Code:
$output .= "<a href=\"/mp3/$file\">$file</a><br />";
then register the variable like you do the otehrs.