getting USER_AGENT Please help me out
Posted: Tue Apr 20, 2004 2:17 pm
Hi all:))
I am building pages for imode cellphones and i wish to have the info regarding specific type of phone in order to load specific images (width height)
the code i am trying to make it work is:
The var1 is the ordinary IE browser and th e var 2 is the cellphone the specific model
What i need is that when the php code detects specific phone model ,then i need to load a specific image. Is that possible.?
So far my code isnt working..(:(
Can someon e please help me out?
Thanks:))
I am building pages for imode cellphones and i wish to have the info regarding specific type of phone in order to load specific images (width height)
the code i am trying to make it work is:
Code: Select all
<?php
$var1 = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)";
$var2 = "portalmmm/2.0 P341i(C10;TB)";
//echo $_SERVERї'HTTP_USER_AGENT'];
if ($_SERVERї'HTTP_USER_AGENT'] ='$var1') {
echo $var1;
}
if ($_SERVERї'HTTP_USER_AGENT'] = '$var2'){
echo "gegeor: WebHosting";
}
?>What i need is that when the php code detects specific phone model ,then i need to load a specific image. Is that possible.?
So far my code isnt working..(:(
Can someon e please help me out?
Thanks:))