Jump to content
MakeWebGames

Recommended Posts

Posted

Hi. I require alittle help on how to secure userlist.php.

 

The following -

 

$st=($_GET['st']) ? $_GET['st'] : 0;

$by=($_GET['by']) ? $_GET['by'] : 'userid';

$ord=($_GET['ord']) ? $_GET['ord'] : 'asc';

 

ultimatly can be injected to effect the following query -

 

$q=$db->query("SELECT u.*,g.* FROM users u LEFT JOIN gangs g ON u.gang=g.gangID ORDER BY $by $ord LIMIT $st,100");

 

Can anyone provide a clear method on how to secure this setup without effecting the sort options on userlist.php in mccodes v2.

 

Many thx in advance for any help.

Posted

Well hey this is likeley to be really wrong, but i attempted fixing Tcmakers problem and it worked so i will attempt this one as well. It appears to me as a string ( then again i may be wrong )

so basically you would do something like $_GET['st']= mysql_real_escape_string($_GET['st']); adding that above it or something like that.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...