Click to See Complete Forum and Search --> : Ie, Ns


metrosoccer12
10-12-2003, 01:16 PM
my site has a problem, some elements of it are not viewable in NS so is there a php script i can use to show a link to an alternate url when a user views the site in NS. I know i could use javascript but id rather not cause some users dont have it enabled... thanks in advance

pyro
10-12-2003, 03:39 PM
I'd recommend just making your pages compliant with all browsers, but if you need to:

$_SERVER['HTTP_USER_AGENT'];

metrosoccer12
10-12-2003, 05:06 PM
uhm im new with this but where would i add $_SERVER['HTTP_USER_AGENT'];?

basicly i just want it to show text if u using netscape

pyro
10-12-2003, 06:19 PM
Something like this should work...

if (preg_match("/netscape/i", $_SERVER['HTTP_USER_AGENT'])) {
echo "You are using Netscape.";
}