I'm having an issue with a nav bar - it doesn't do drop down for IE6. Well, after 3 hours of playing with it, I found that there isn't a good solution for a drop down menu that uses hover over images and works in IE 6, 7, 8 and current versions of FireFox, Chrome and Safari. My current version works great on everything other than IE 6.
So, my solution: Keep the current nav bar for all users except IE 6, those guys get a different nav bar loaded.
So, I need to load inc_ie6_nav.php instead of inc_nav.php - conditional comments didn't like this, evidently they don't work with includes.
So, I figured I would write a php script to check the browser. Thats where I'm at right now.
The script below works almost properly and on IE 6 it pulls a value of "MSIE 6.0", it gets all kinds of other randomness with other browsers which is fine. What I want it to do is compare what it finds with the set value of "MSIE 6.0" and if it finds that it is the same, it loads the IE 6 nav bar, if it is different, it loads the normal nav bar.
However, for whatever reason, the compare portion isn't working. It always returns that it is not the same, even when it is the same.
I even have it echoing the two items to compare so I can see for myself if it is the same. Indeed, on IE 6 it loads up that $os is "MSIE 6.0" and that $ie6 is "MSIE 6.0" as well.
Any ideas?
So, my solution: Keep the current nav bar for all users except IE 6, those guys get a different nav bar loaded.
So, I need to load inc_ie6_nav.php instead of inc_nav.php - conditional comments didn't like this, evidently they don't work with includes.
So, I figured I would write a php script to check the browser. Thats where I'm at right now.
The script below works almost properly and on IE 6 it pulls a value of "MSIE 6.0", it gets all kinds of other randomness with other browsers which is fine. What I want it to do is compare what it finds with the set value of "MSIE 6.0" and if it finds that it is the same, it loads the IE 6 nav bar, if it is different, it loads the normal nav bar.
However, for whatever reason, the compare portion isn't working. It always returns that it is not the same, even when it is the same.
PHP:
<?php
$string = $_SERVER['HTTP_USER_AGENT'];
$chunks = spliti (";", $string);
$os=$chunks[1];
$ie6 = "MSIE 6.0";
echo $os.'<br><br>';
echo $ie6.'<br><br>';
if ($os == $ie6)
{
echo "You are using IE 6";
}
else {
echo "Yay, no IE 6!";
}
?>
I even have it echoing the two items to compare so I can see for myself if it is the same. Indeed, on IE 6 it loads up that $os is "MSIE 6.0" and that $ie6 is "MSIE 6.0" as well.
Any ideas?