help please on browsererm table
Collapse
X
-
Originally posted by just_m3. View Postsimple mysql_real_escape_string should solve your problem use mysql_escape_string if you have a low php versionPHP Code:$agent=$_SERVER['HTTP_USER_AGENT'];
$res = mysql_query("UPDATE ibwf_users SET browserm='".mysql_real_escape_string($agent)."', ipadd='".mysql_real_escape_string($uip)."' WHERE id='".getuid_sid($sid)."'");
also $agent ="$HTTP_USER_AGENT"; is wrong , you should pass only the variable equal without qoutes " " and also ! the right form for requesting user agent is $_SERVER['HTTP_USER_AGENT']; not $HTTP_USER_AGENT . hope it helps :p
$agent ="$HTTP_USER_AGENT";
selects the function of $HTTP_USER_AGENT which is stated below
$HTTP_USER_AGENT = mysql_escape_string($HTTP_USER_AGENT);
i fixed it earlier it was sending it to all users in the field now it sends to the field of the user logging in ive covered the whole part of the site where info is retrieved and or posted or updated etc with mysql_real_escape_string
and btw im running the latest version of php5 and coding the script to not rely on globalsLast edited by ozziemale31; 19.06.12, 21:35.
Leave a comment:
-
Originally posted by ozziemale31 View Postbut it seems to not just update just the one user as it should
-------------------------------------------------------------
please note if u change browser or inject it with any other table data this doesnt happen
Added after 3 minutes:
dont worry issues solved
simple mysql_real_escape_string should solve your problem use mysql_escape_string if you have a low php versionPHP Code:$agent=$_SERVER['HTTP_USER_AGENT'];
$res = mysql_query("UPDATE ibwf_users SET browserm='".mysql_real_escape_string($agent)."', ipadd='".mysql_real_escape_string($uip)."' WHERE id='".getuid_sid($sid)."'");
also $agent ="$HTTP_USER_AGENT"; is wrong , you should pass only the variable equal without qoutes " " and also ! the right form for requesting user agent is $_SERVER['HTTP_USER_AGENT']; not $HTTP_USER_AGENT . hope it helps :p
Leave a comment:
-
help please on browsererm table
hi getting back into coding again but came across a bug
browserm table when a user logs in seems to update all users with your browser if it isnot recognised
ive tried following
but it seems to not just update just the one user as it shouldPHP Code:
$HTTP_USER_AGENT = mysql_escape_string($HTTP_USER_AGENT);
$agent ="$HTTP_USER_AGENT";
$res = mysql_query("UPDATE ibwf_users SET browserm='".mysql_real_escape_string($agent)."', ipadd='".mysql_real_escape_string($uip)."' WHERE id='".getuid_sid($sid)."'");
-------------------------------------------------------------
please note if u change browser or inject it with any other table data this doesnt happen
Added after 3 minutes:
dont worry issues solved
Last edited by ozziemale31; 19.06.12, 01:07.Tags: None
Leave a comment: