TIP:
<?php
######################################################################################################
## File: inc.security.php ##
## Version: 1.0 ##
## Project: CMS AMC ##
## Author: Alfonso E. Martínez de Castro Jiménez ##
## Last Date Modified: 03-06-09 ##
## Change log: 1.0 |03-06-09| Original version, the file was created ## ##
## Function: This file provide the security against the attacks SQL, XSS, DoS, etc. ##
######################################################################################################
//----------------------------------------------+
// We claer all traffic of our server |
//----------------------------------------------+
// This function I extrac of SMF system fourum, cleared all " and ' in traffic server
function addslashes__recursive($var){
foreach ($var as $k => $v)$new_var[addslashes($k)]=addslashes__recursive
($v); return $new_var;
}
//If the magic quotes are disable, aplicate the function, else, do not nothing
$_POST=addslashes__recursive($_POST);
$_GET=addslashes__recursive($_GET);
$_REQUEST=addslashes__recursive($_REQUEST);
$_SERVER=addslashes__recursive($_SERVER);
$_COOKIE=addslashes__recursive($_COOKIE);
}
// With this function, we are clear the html chars to entity ascii
function clear_chars($var){
}
else{
foreach ($var as $j => $p){
}
return $new_var;
}
}
if($_POST) $_POST=clear_chars($_POST);
if($_GET) $_GET=clear_chars($_GET);
if($_REQUEST) $_REQUEST=clear_chars($_REQUEST);
if($_SERVER) $_SERVER=clear_chars($_SERVER);
if($_COOKIE) $_COOKIE=clear_chars($_COOKIE);
$var=addslashes__recursive($var);
$var=clear_chars($var);
//----------------------------------------------+
//---------------------------------------------------+
// Now, is time the best friend, a antidos-flood :) | |
//---------------------------------------------------+
//require("antidos/anti_dos.php");
?>