You shouldn't need the opening php tag - as it's already inside a tag.

I've done banner ads with a similar trick.

Do you get any errors or anything?