Not so much a question, I’m looking more for opinions.
I’ve been trying to rack my head around a generic warning that could have adaptable reason and width variables when a user is using Internet Explorer to view a page. I ended up with this.
[b]Page
[code=php]<?php
include “ie.php”;
?>
[CODE]<SCRIPT TYPE=”text/javascript”>
<!–
if (navigator.appName == “Microsoft Internet Explorer”){ document.writeln(‘<?php echo “”.ie(85, ugly).””; ?>’); }
// –>
</SCRIPT>
[b]ie.php (included)
[code=php]<?php
function ie($width, $reason){
if($reason == ‘ugly’){ $reas=”This page is truly, truly, truly, truly, truly (etc.) hideous on Internet Explorer”; }
$display=”<br><table border=1 bordercolor=#000000 cellpadding=2 cellspacing=0 class=warn width=”.$width.”%><tr><td class=warn align=center>”.$reas.”. We implore you to use a proper browser when viewing this page, as your face will fall off otherwise.<p><a href=http://www.mozilla.org/><font color=lime>Mozilla Firefox</font></a></td></tr></table>”;
return $display;
}
?>
It all works fine and I’m pleased with the result, especially as IE makes such a mash up of the content of the page, but what do you guys think?