Full Browser info on Lavalair
Started on the old forum in May 2015 · view the original in the archive · old links redirect here
remove the explode($browser) from index.php - you may also want to change the browser field in the database to contain 255 characters
$ubr = $_SERVER["HTTP_USER_AGENT"];
you may also want to use mysql_escape_string() to stop any browser sql injections
eg:
$ubr = mysql_escape_string($_SERVER["HTTP_USER_AGENT"]);
stefan998 wrote: Than you very much,it worked perfectly,i have one question:Does anyone know how to upload smilies with code directly from phone/computer because when i upload smilies i must enter url of the smiley and then when you send pm it gets reported
Don't add it with http, add just folder location.
./folder/smiles/smile.gif
stefan998 wrote: Now on browser is showing opera9.80/(Android bla bla) but not phone model
See this: </t/7367-detect-real-user-agent>
//////
$ubr = isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA']) ? mysql_real_escape_string($_SERVER['HTTP_X_OPERAMINI_PHONE_UA']) : mysql_real_escape_string($_SERVER['HTTP_USER_AGENT']);
//////
stefan998 wrote: Hi,when i look on user profile i want to see full browser infi,now it says for example Browser:Opera 9.80,bu i want to say Browser:Opera 9.80/Nokia E5. Can someone help me to solve this problem.Thank you very much:)
copy this code and paste in index.php
$agent = mysql_real_escape_string ($_SERVER['HTTP_USER_AGENT']);
$agent2 = $agent;
now put this code in core
///////////////////////////////////////////Get Browser in detail
function getbrowser_uid($uid)
{
$not = mysql_fetch_array(mysql_query("SELECT useragent FROM ibwf_users WHERE id='".$uid."'"));
return $not[0];
}
now put this new table in ibwf_users
`useragent` varchar(250) NOT NULL,
make sure u put this code in index.php else it will show blank
$res = mysql_query("UPDATE ibwf_users SET browserm='".$ubr."', useragent='".$agent2."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'");
now put this in user profile to see their user agent
$nopli = mysql_fetch_array(mysql_query("SELECT useragent FROM ibwf_users WHERE id='".$who."'"));
echo "User Agent Details:</b> $nopli[0]<br/>";
WANT GOOD CHEAP HOSTING WITH 99% UPTIME? THEN PM ME FOR DETAILS!!
stefan998 wrote: Thanks,but i must replace mysql_escape_string with mysql_real_escape_string because it will send error
practice using mysqli instead of mysql 🙂 mysql will be depreciated soon
External image (may be gone) http://wapx.amob.com Applications, Games, Wallpapers, Ringtones, Videos, Themes, Screensaver and More!!!