|
as RDS was saying, PHP is a server-side language, and operates once -- including all of the php includes and other processing -- before the page loads, and then send the result to the client. and that's the end of the PHP, the server releases it like an abandoned child and thinks of it no more.
for what you want to do, I would put the banner in an IFRAME on the page. This can be loaded seperately, and can be triggered through javascript or a META <refresh> tag to reload itself. It has to reload so that the server will be forced to process the PHP again.
here are some other options: 1) use JS/DHTML to write the banner on-the-fly, and then use the .innerHTML tags to alert the text. advantages: no reloads, or extra server communication needed. disadvantages: all possibilities must be contained in the original page. you don't have to load every image if you want to swap images too, but you have to have the text of the image location to plug into the HTML later
2) use flash to display the banner/text -- or at least the text. Advantages: you can format it pretty, and take care of all the server communication through flash. Disavantages: unless your banner images are in swf form, or you have preloaded them all into the flash movie, if you want to dynamically change your images your users will need flash6 player to load extra images.
3) you can use various combinations of these options. for instance, you can use an invisible flash movie to connect to the server and retreive the new banner/text, and then send that back to the Javascript, which can update the page with JS/DHTML and the .innerHTML tag.
cheers! LuxFX
|