Animated image with PHP


this might be an HTML or CSS question, but since I’m building this new site with PHP I thought I would ask here since you guys are so good with answers. I have the attached image. every 5 seconds or so it changes to another image. I’m not sure how this guy did it initially, although I have used animated GIFs in my forum avatars before. he currently has this GIF inside a < div > located right below his horizontal CSS menu near the top of each page. If I want to build a new site in PHP, would this image virtually stay the same in terms of literal placement within the HTML code of the page? I assume yes, as this has nothing to do with PHP, right?

All correct. This has nothing to do with php other than maybe adding the src to the image itself.

If you are asking this about php because of statements that php is used to produce ‘dynamic’ web pages or produce ‘dynamic’ content on web pages, keep in mind where and when php code runs. It runs on the server when a page gets requested. The ‘dynamic’ in those statements are with respect to what happens on the web server when the page gets produced. A php script would ‘dynamically’ get the correct username and avatar image ‘name’ for the current logged in user and output these dynamic/variable values in the correct place in the html markup for the web page, before it gets output to the requesting browser. In the case of different types of users, it would dynamically/conditionally produce html markup that’s different between each user type. In the case of dynamic content on a page, a value as part of the requesting url, would cause the php code in one file to get and display different content or even completely different purpose pages based on what was requested.

I understand, phdr. thanks. I will get back to you guys shortly. Give me some time to do my research and see if things work out though. I’m sure I’ll have follow up questions to this one!

I wanted to let you experts know I’m still working on this. I will post another reply when I’m able to implement something. thanks.

Sponsor our Newsletter | Privacy Policy | Terms of Service