Do you have a question? Post it now! No Registration Necessary. Now with pictures!
September 28, 2004, 5:02 am
rate this thread
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>
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 :-)
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?
What about redirecting all requests to
www.adverserver.com/mysite/id=324234 to a php script, which then does
$mybanner++ and sends your banner?
- » How to reference an array in multidimensional array?
- — Previous thread in » PHP Scripting Forum