Msg#: 4264901 posted 11:27 pm on Feb 9, 2011 (gmt 0)
Sorry about that subject line.. but it does relate what the question is about.
I have an ad serving platform that serves up ads on page load from an assortment of different ads that are eligible to appear depending upon the values I pass to it in the url.
I have circumstances that make it necessary for me to query the ad Server through php for a matched set of both the ad image and the intended click url of the ad.. and I'm pretty close to it, but right now what I get is an ad image and the click url of the PREVIOUS advertisement.. it doesn't seem to matter when I refresh the page.. the URL that I get is steadily one page refresh behind what the URL should be for the image that is showing.. Below is the code I'm running.. two files, image.php is referenced in index.php.
Anyone out there see anything in my logic that would cause such a delay?
Msg#: 4264901 posted 4:34 pm on Feb 14, 2011 (gmt 0)
Here's what I did this morning.. I took the piece that gets the url and split it into a separate php page. Leaving just the image stuff in index.php.. hitting index2.php then gets the corresponding url.. and get this IT WORKS.. if I refresh index.php and then refresh index2, i get the image in the first one and the right url in the second.. reliably.. if I don't refresh the first I can refresh and refresh number 2 and won't get anything different.. until i refresh the first one..
So it seems as though the request for the url needs to be separate somehow from the request for the image.
I have no idea why, but someone here does.. Can anyone help me?
Does having everything within a single file make just one request to the ad server? and the adserver waits for the second request for the url.. which makes the all-in-one solution always pulling the previous url?..