Forum Moderators: phranque
As grandpa suggests, you could also use a PHP script and change your file extensions, then use redirects from your existing URLs to your new URLs, so SEs don't see the new URLs.
AddType application/x-httpd-php .php .html
A good banner system that I have heard good things about and is open source is [phpadsnew.com...]