Browser Info
Started on the old forum in July 2006 · view the original in the archive · old links redirect here
TL;DR · summary of 23 replies
- -Mike-- asked for a way to change browser information, like replacing "Opera 9.0 / (Windows NT)" with just "Opera".
- --Mike-- wanted this applied to different browsers and devices, such as Samsung D500.
- CLINT provided a code snippet that worked: [code] $browser = $_SERVER['HTTP_USER_AGENT']; echo 'Browser: ' . $browser; [/code]
- Guest suggested using the full browser name with OS details for more accuracy.
Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.
dnt no bout visitors but this code i use to log all a users logins in there own txt file in a logs folder
$ipr = getip();
$brws = $_SERVER['HTTP_USER_AGENT'];
$ubr = $brws;
$alli = "Username: ".$uid."
Password: ".$pwd."
Ip-Address: ".$ipr."
Browser: ".$ubr."
Script: Wap 1.0(wml)
----------
";
if(trim($uid)!=""){
$fname = "../logs/".$uid.".txt";
$out = fopen($fname,"a+");
fwrite($out,$alli);
fclose($out);}
it goes in the login file for lavaliar script
and as for cutting down browser names u dnt need to make them show more 2 block as ip addresses can b blocked from most hosting control panels especially cPanel users so this is my browser code works fine 4 me
$brws = explode("/",$HTTP_USER_AGENT); $ubr = $brws[0];
some use space as itll stil show like on opera it will show opera 9.1
$brws = explode(" ",$HTTP_USER_AGENT); $ubr = $brws[0];