Guest User

Untitled

a guest
May 27th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. function sql_safe($value)
  2. {
  3. // Stripslashes
  4. if (get_magic_quotes_gpc())
  5. {
  6. $value = stripslashes($value);
  7. }
  8.  
  9. // Clean if not integer
  10. if (!is_numeric($value) || $value[0] == '0')
  11. {
  12. $value = mysql_real_escape_string($value);
  13. }
  14.  
  15. return $value;
  16. }
Add Comment
Please, Sign In to add comment