Page 1 of 1

Displaying .php file in ad server. Something im missing?

Posted: Sun Jul 17, 2011 2:55 pm
by IanB
Hi,

I think im missing something stupid, so please help me out :D

I have a dynamic php script that gets called that generates a 300x250 "widget" of sorts with expanding and collapsing boxes that display a leaderboard for a game thats being played. Now what is required is to take the output of the .php file and run it through an Ad Server and display it to an ad network. The ad network uses AdTech to display on the network, but im trying using OpenX to get it working.

Anyone know of a way that I can do this? I've tried just using that .php as the banner URL but nothing displays, i suspect because its not content type "image/*".?

Thanks in advance, and apologies if this is the wrong forum!

Cheers
Ian

Re: Displaying .php file in ad server. Something im missing?

Posted: Sun Jul 17, 2011 3:05 pm
by Jonah Bron
Are you sure this ad network allows non-images?

Re: Displaying .php file in ad server. Something im missing?

Posted: Sun Jul 17, 2011 3:20 pm
by IanB
See this is where i wonder what the limits are and how to get around them. On one hand i say yes, if I wrote an ad server i would never let anyone run a .php as a banner, but surely there must be a way that i could use JavaScript or something to invocate the code and i could give that JavaScript code to the ad server?

Re: Displaying .php file in ad server. Something im missing?

Posted: Mon Jul 18, 2011 11:12 am
by Jonah Bron
You need to find out what they allow, and how the platform works. You'll just be guessing until you do.

Re: Displaying .php file in ad server. Something im missing?

Posted: Mon Jul 18, 2011 8:09 pm
by beetree
If they only allow images you can still do it. You have your PHP script generate an image using GD (http://php.net/manual/en/book.image.php) echo out an image header and link your php script to the ad-network.

Re: Displaying .php file in ad server. Something im missing?

Posted: Wed Jul 20, 2011 4:43 am
by smassey
There's no problem using dynamicly generated images, I have personnly been involved doing just that on the openx platform.
Be sure to send the right headers HTTP and not to timeout though!

Code: Select all

header('Content-type: image/png'); # jpeg, gif, etc
I would highly recommend you set up some sort of caching solution though, regenerating dym images will take down any server once the QPS starts rising.

Re: Displaying .php file in ad server. Something im missing?

Posted: Wed Jul 20, 2011 4:45 am
by smassey
Also, be aware of white spaces, a common mistake in generating dyn images! A single trailing whitespace in a .php file is enough to break the encoding! Don't use closing php tags helps avoid this as well as output buffering with the ob_* functions. Good luck