Outshine
07-28-2004, 05:58 AM
Hello Everyone,
I'm trying to detect browser type and include different menu files based on the browser type. This is what I'm doing:
<?php
if (!(strpos($HTTP_USER_AGENT,'Mozilla/5') === false)) {
echo("<? include('menunet.php') ?>");
} else {
echo("<? include('menu.php') ?>");
}
?>
Unfortunately it's not including anything at all. I've tried various methods, as well as using a similiar method in Javascript but I'm getting the same result each time - nothing shows. Is it possible to do it this way, or am I going in the wrong direction? I've also tried to do the detection inside of the menu.php file and echo out the appropriate code - but it's lengthy and doesn't seem to work, either. As always, your expertise is appreciated.
Thanks
Luke
I'm trying to detect browser type and include different menu files based on the browser type. This is what I'm doing:
<?php
if (!(strpos($HTTP_USER_AGENT,'Mozilla/5') === false)) {
echo("<? include('menunet.php') ?>");
} else {
echo("<? include('menu.php') ?>");
}
?>
Unfortunately it's not including anything at all. I've tried various methods, as well as using a similiar method in Javascript but I'm getting the same result each time - nothing shows. Is it possible to do it this way, or am I going in the wrong direction? I've also tried to do the detection inside of the menu.php file and echo out the appropriate code - but it's lengthy and doesn't seem to work, either. As always, your expertise is appreciated.
Thanks
Luke