Skip to content

Instantly share code, notes, and snippets.

@scragg0x
Created May 8, 2013 19:02
Show Gist options
  • Save scragg0x/5542772 to your computer and use it in GitHub Desktop.
Save scragg0x/5542772 to your computer and use it in GitHub Desktop.
mysql escape request
<?php
// Use for $_POST $_GET and $_COOKIE vars
function mysql_escape_request($str){
if (get_magic_quotes_gpc()) {
$str = stripslashes($str);
}
return mysql_real_escape_string($str);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment