Sorry, I don't think I was clear. The <A HREF etc. part is static, it's being called on a remote server, so the SRC in the IMG tag has to load a random banner, and remember which one it loaded, so if the link is clicked, it goes to the right place.
I just took a look at phpAds, which does this, but I'm trying to overcome the problem of if the user has more than one window open, and different banners display, with phpAds they both go to the same place when clicked.
I've fixed it with javascript, I just use:
<SCRIPT LANGUAGE="JavaScript" SRC="http://mysite/banner.js.php"></SCRIPT>
and a php file outputs some document.write statements with a random banner, but for the NOSCRIPT part, it looks like I'm stuck with phpAds method.