Personally, I am not too bothered by the idea of if(IE6), which would be quite easy to implement in PHP. However, there are two problems with that:
1. It is a pain to setup in terms of design: you would have to have extra PHP code on your page for every image you want.
2. IE6 is not the only browser that will have problems. Other browsers, such as text only browsers, will also have odd results, so having a page that relies on certain effects is bad and it should downgrade smoothly.
Despite this, though, IE6 is certainly the most likely "bad" browser, so specifically dealing with it is possible. User-agent strings are not reliable and can be faked, but if this is not security and you are wanting to just help the average user of IE6 to see your page correctly, it will work most of the time.
PHP Code:
<?php
if (strpos($_SERVER['HTTP_USER_AGENT'],'IE6')) { //***
//do IE6 stuff
}
else {
//do the normal code
}
?>
The line I marked with *** searches the User Agent string (sent by the browser to the server) for "IE6". I don't have IE6 available at the moment, so you need to determine what the best thing to search for to identify the browser is. The string will vary slightly by system, so find a short phrase like "Internet Explorer v6" or whatever is common to all of them.
(Just echo $_SERVER['HTTP_USER_AGENT']; to see what the browser is sending.)
It seems unreasonable to me, though, that you would need to go this far with fixing something for one browser, so I'm not sure I'd recommend using the code above, but it would work if you want.
Bookmarks