Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

MSSQL Anti Injection

◝(⁰▿⁰)◜Smile◝ (⁰▿⁰)◜
Developer
Joined
May 29, 2007
Messages
2,167
Reaction score
899
You use prepared statements.
 
Tantra Freelancer
Joined
Apr 9, 2014
Messages
541
Reaction score
23
You use prepared statements.

Unfortunately I don't have any idea how to make one. If you don't mind, can you share some links here in RaGEZONE that most likely you recommend to be use which is also effective?
 
Skilled Illusionist
Joined
Mar 31, 2011
Messages
382
Reaction score
48
Through the game, the web or how?
 
Skilled Illusionist
Joined
Mar 31, 2011
Messages
382
Reaction score
48
Web in Ranking page.

Use a function:
PHP:
function antiinjectsql($tzgd){
    /* Function anti sql injection by Amir Torrez */
    $bn = array ("==", , "%s", "or 1", "'", "select", "insert", "from", "where", "exec", "0x", "set", "declare", "sql", '"');
    $tzgd = preg_replace ($bn,'', $tzgd);
    return $tzgd;
};

Call the function in the variables, example:
PHP:
$dios = antiinjectsql($_GET['dios']);

Use it in any variables, for example, GET and POST.
 
Newbie Spellweaver
Joined
Apr 8, 2008
Messages
59
Reaction score
0
Use a function:
PHP:
function antiinjectsql($tzgd){
    /* Function anti sql injection by Amir Torrez */
    $bn = array ("==", , "%s", "or 1", "'", "select", "insert", "from", "where", "exec", "0x", "set", "declare", "sql", '"');
    $tzgd = preg_replace ($bn,'', $tzgd);
    return $tzgd;
};

Call the function in the variables, example:
PHP:
$dios = antiinjectsql($_GET['dios']);

Use it in any variables, for example, GET and POST.


Para evitar llamar la funcion en cada variable se puede usar lo siguiente usando tu función:
foreach( $_GET as $variable => $valor ){
$_GET [ $variable ] = antiinjectsql($_GET [ $variable ]);
}


foreach( $_POST as $variable => $valor ){
$_POST [ $variable ] = antiinjectsql($_POST [ $variable ]);
}
Y se incluye este archivo en el config o al inicio de la web.

Saludos!
 
Skilled Illusionist
Joined
Mar 31, 2011
Messages
382
Reaction score
48
Para evitar llamar la funcion en cada variable se puede usar lo siguiente usando tu función:

Y se incluye este archivo en el config o al inicio de la web.

Saludos!

Exactamente, aunque prefiero manual, debido al contenido de algunas otras variables, pero es a gusto del consumidor.

!= Exactly, although I prefer manually, due to the content of some other variables, but it is to consumer tastes.
 
Newbie Spellweaver
Joined
Apr 8, 2008
Messages
59
Reaction score
0
Tuve problemas igualmente con unas variables, por ejemplo con el reCaptcha. Pero eso se puede solucionar con esto:

!= I had problems with some variables, for example with reCaptcha. But that can be fixed with this:

PHP:
foreach( $_POST as $variable => $valor ){ 
    if ($variable=='g-recaptcha-response') { 
        continue;
    }
$_POST [ $variable ] = anti_injection($_POST [ $variable ]); 
}

PD: Tendre cuidado con los gringoliebers
 
Back
Top