Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I manage a small site and here and there we manage to sell some banners.
Recently we started working with an advertising company who (of course)
requires us to pull banners from their server. The problem is: although we
sell a certain number of impressions their server load balances the
impressions and if too much banners are being showed he sends back our own
banner. Problem? I can never tell how many real banners I showed and how
many of my own banners. Yes there's a stats page at the advertisers server
but..... I have my own stats app which has become useless....

So.... the process of showing a banner goes something like this:
    -user requests page
    -page runs db query and gets a banner
    -echo <a><img src="banners/asdasd.jpg"/></a>
    or ...
    echo <a><src="www.adverserver.com/mysite/id=324234" img/>

What do I want? :-)
I want to know exactly how many my banners and "real" banners are showed.
Therefore I came up with the following encapsulation idea :-)
I fopen the www.adverserver.com/mysite/id=324234 check the size, if it's ==
with my banner I do a mybanner++ query else their_banner++ query. Show the
image and everybody is happy :-)
There are of course some technical problems related to my idea because I
have to echo a raw image on a page that already sent headers but I'll think
of something :-))

Is there any better/faster/smarter way to deal with my problem?


in case anybody from Croatia/Slovenia is familiar with the situation the
advert company is Httpool :-)

Re: encapsulation

Quoted text here. Click to load it

You could buffer all the page contents. i.e. use "$page_string .= XXX"
instead of "echo XXX", and do echo $page_string at the end of page.

But since the page has to do a db query to get banner link, why not
check it there?

Quoted text here. Click to load it

What about redirecting all requests to
www.adverserver.com/mysite/id=324234 to a php script, which then does
$mybanner++ and sends your banner?

Quoted text here. Click to load it

uh.. Croatia?

Site Timeline