xenogfx
New Member
- Oct 24, 2011
- 24
- 12
Want to protect your site from xss and sql injections? pass all your $_GET / $_POST vars through this function and you'll remain secure for the rest of your meaning full online life.
PHP:
<?php
/**
* @Author Deformed aka XenoGFX
* @Copyright 2012
* @Description Simple XSS / SQL injection protection
*/
function mClean($str)
{
return mysql_real_escape_string(htmlentities($str));
}
// Usage
$username = mClean($_POST['username']);
$id = mClean($_GET['id']);
?>