Most consumer users do have javascript enabled, or partially enabled enough to rotate an image. Corporate and large business users would have a much higher percentage of JS disabled.
If the site's target market is the former, I'd add a static image to display using <noscript> tags.
If it's the latter, or you simply HAVE to have that rotating image, then I'd ask for / get a php include script written up to handle the image rotation. Then configure the server via htaccess, or a request to the IIS tech hosting your site, to have html files added to the php application pool.
For such a small site, adding html to the app pool isn't going to have a noticable effect. DW templates can happily exist with php includes written in.
If you need php code for the above, I'd be glad to chuck something up for you. if you go for the noscript approach, this is as simple as adding the tags immediately after the inline js script finishes:
<noscript>
<img src="anImage.gif" />
</noscript>
Main Topics
Browse All Topics





by: psimationPosted on 2007-05-14 at 05:08:34ID: 19084321
The only time your webserver will "parse" the php is if your file's extension is mapped to the php application. Usually, only .php, .php4, .php5, .phps etc is mapped to the php parser. So, if you put php code in your .dwt file, it will not work.
I am not familair with the way you work in Dreamweaver, BUT, I would be suprised if the actual resulting file Dreamweaver will save for you would still have the .dwt extension. I have a suspision that the .dwt is an "internal" file extension used only by dreamweaver to "construct" your template, but when you save or publish the website, then the actual files will have .html extensions. The reason for my sus[pision is this: Apache does NOT have .dwt as a standard extension in it's configuration, so if you browsed to a .dwt file with Apache as the webserver ( even IIS if I should take a guess), then you would NOT see a nicely formed website, instead, you will most probably see the source.
Dreamweaver does have a "php template" feature, where you can create a php template and all the files in question are capable of being parsed by PHP due to the extension ( remember, you can call a 100% pure html file xxx.php and it will work, but not the other way around - unless you configure your webserver - but that is highly in-efficient)
To do a PHP image swap, I would work with sessions so that you can track how many times a particular user has viewed a page, and then you can dynamically load a different picture if they have seen the page before.