Posted By

Tamedo on 01/02/08


Tagged


Versions (?)

clean GET_ID


 / Published in: PHP
 

  1. $clean = ($_GET['id']);
  2.  
  3. function cleanQuery($clean)
  4.  
  5. {
  6.  
  7. if(get_magic_quotes_gpc()) // prevents duplicate backslashes
  8.  
  9. {
  10.  
  11. $clean = stripslashes($clean);
  12.  
  13. }
  14.  
  15. if (phpversion() >= '4.3.0')
  16.  
  17. {
  18.  
  19. $clean = mysql_real_escape_string($clean);
  20.  
  21. }
  22.  
  23. else
  24.  
  25. {
  26.  
  27. $clean = mysql_escape_string($clean);
  28.  
  29. }
  30.  
  31. return $clean;
  32.  
  33. }

Report this snippet  

You need to login to post a comment.