By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,441 Members | 1,468 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,441 IT Pros & Developers. It's quick & easy.

encapsulation

P: n/a
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?

cheers,
gordan

PS
in case anybody from Croatia/Slovenia is familiar with the situation the
advert company is Httpool :-)
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Gordan" <go****@torkulMAKNI.hr> wrote in message news:<cj**********@news1.xnet.hr>...
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 :-))
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?

Is there any better/faster/smarter way to deal with my problem?
What about redirecting all requests to
www.adverserver.com/mysite/id=324234 to a php script, which then does
$mybanner++ and sends your banner?

cheers,
gordan

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


uh.. Croatia?
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.