clean_form_input.php
<?php
/*
Function: clean_form_input
cleans tainted form data - trims white spaces from the beginning and end of the string, strips added
slashes if there are any, and converts any other characters into their HTML
equvalents.
Parameter: $tainted_data - the tainted form data.
*/
function clean_form_input($tainted_data) {
if(get_magic_quotes_gpc()){
$tainted_data = stripslashes($tainted_data);
}
$cleaned_data = htmlentities(trim($tainted_data));
return $cleaned_data;
}
?>
Paul's Code Library
Categories
HomeAJAX
classes
database_functions
date_functions
file_functions
googlevideo_and_youtube_api
htaccess
image_functions
string_functions