Jump to content
MakeWebGames

Is this for real?


Kieran-R

Recommended Posts

Hello.

Well while surfing, I found this function while "supposedly" secured all your $_GET and $_POST variables:

 

            function anti_inject($campo)
{
   foreach($campo as $key => $val)
   {
       $val = mysql_real_escape_string($val);
       // store it back into the array
       $campo[$key] = $val;
   }
   return $campo; //Returns the the var clean
}

//the next two lines make sure all post and get vars are filtered through this function
$_POST = anti_inject($_POST);
$_GET = anti_inject($_GET);

 

I was wondering if simply putting this in globals protects your game from these kind of attacks?

Thanks

Link to comment
Share on other sites

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