Let me give you a quick overview before getting to the problem. Currently we have 8 ad servers. We are trying to make a site which will connect to each server and return back an ad banner, so loading the page will connect with all 8 servers and return 1 ad banner from each server.
Initially, javascript was used to connect to the servers using the server IP and location of the banner. But I was told to try to change it into iframes which I did. I'm no expert, but I was told a method which did work. This method had me create 8 new notepad txt files and each txt file contained one line of javascript code pertaining to a certain server. So 8 servers, 8 javascript lines in 8 txt files. For the sake of clarity, we'll call them adserver1.html, adserver2.html all the way to adserver8.html.
Then we have a site called servertest.html. The purpose of servertest.html is to test how quickly each of the 8 servers respond and the appropriate delay should be reflected on the site. So if one server responds fast, the ad banner pops up immediately and if another ad server responds 2 seconds slower, the ad will op up after 2 seconds of delay. (That was just an example, in reality, the delay is however long it takes for the server to respond).
The 8 iframe code lines are in this site (servertest.html). So for example, we have the iframe code of:
Expand|Select|Wrap|Line Numbers
- <iframe src="adserver1.html" align="center" height = "140px" width = "200px" scrolling="auto"></iframe>
The adserver1.html file has the following line (the X's is the server IP address):
Expand|Select|Wrap|Line Numbers
- <script language="javascript" type="text/javascript" src="http://XXX.XXX.XXX.XXX/bannercode/5251/04FF9A29A4ED390C0A260146E8E2080E.php">
- </script>
OR, if it's easier, perhaps get rid of iframes completely and use some other method either using PHP or other languages.
Keep in mind the main goal of this is to test how quickly each server responds and displays their ad banner.
Is there a way, using PHP, to achieve this in a single document rather than having a total of 9 separate documents?