PHP won't execute inside the header, but you can put it inside the /templates/default/ubbt_header.tmpl

Try adding this:

<pre>
require "ad.php";
$advertisement = show_ad();

// page shows something here
echo $advertisement // the banner appears
</pre>

between these 2 lines:

<pre>
UBBTPRINT
/* UBBTREMARK */ ?>
</pre>