Advertisement
FeRR4L

Anti Sql-Injection by H5H

Jun 20th, 2013
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. <?
  2. if(!function_exists("antiSQL")) {
  3. function antiSQL($campo, $adicionaBarras = false) {
  4. $campo = preg_replace("/(from|alter table|select|insert|delete|update|were|drop table|show tables|#|\*|--|\\\\)/i","Anti Sql-Injection  !",$campo);
  5. $campo = trim($campo);
  6. $campo = strip_tags($campo);
  7. if($adicionaBarras || !get_magic_quotes_gpc())
  8. $campo = addslashes($campo);
  9. return $campo;
  10. } }
  11. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement