help please on browsererm table

Started on the old forum in June 2012 · view the original in the archive · old links redirect here

3 replies · 362 views · started 14 years ago · 1 min read

3 participants
ozziemale31 Lead · 861 posts #1

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

$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)."'");

but 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 🙂

External image (may be gone) External image (may be gone)

External image (may be gone)

*****

**Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer.. Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free ***

just_m3. Developer · 199 posts #2

ozziemale31 wrote: but 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 :)

$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)."'"); 

simple mysql_real_escape_string should solve your problem use mysql_escape_string if you have a low php version 🙂 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 😛

This is ten percent luck, twenty percent skill Fifteen percent concentrated power of will Five percent pleasure, fifty percent pain 😂And a hundred percent reason to remember the name!

ozziemale31 Lead · 861 posts #3

just_m3. wrote:

$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)."'"); 

simple mysql_real_escape_string should solve your problem use mysql_escape_string if you have a low php version 🙂 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 globals

External image (may be gone) External image (may be gone)

External image (may be gone)

*****

**Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer.. Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free ***

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close