Jump to content

sql injections


stevehossy

Recommended Posts

I own a game site. THere is always one user who exploits a page and does an sql injection. This game was bought from a site, the codes are very vulnerable. So im starting to add some protection to the scripts. FOr text boxes, i did html special chars. So its not possible to send a query. Is this good? Also, ive added this:

 

$url =$_SERVER['REQUEST_URI'];
$code_entities_match = array('%','--','!','~','`','(',')','select','from','where','-','$','#','*');
$code_entities_replace = array('','','','','','','','','','','','','','');
$url1 = str_replace($code_entities_match, $code_entities_replace, $url);
if($url != $url1)
{
die("<b>Error</b>");
}

 

I know these two things wont protect me from all. BUt is it a good start? Also any other sql protection tips? THanks!

Link to comment
Share on other sites

  • 4 years later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.