...

View Full Version : Different Include based on Browser Type



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

As5a5sIn5
07-28-2004, 06:08 AM
you dont echo include get rid of echo put
<?php
if (!(strpos($HTTP_USER_AGENT,'Mozilla/5') === false)) {
include("menunet.php");
} else {
include("menu.php");
}
?>

Outshine
07-28-2004, 06:12 AM
Works perfectly. Thank you very much!

Luke



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum