// Clean the input data function clean_input_data ($input) { // // First, clean the input data // // If magic quotes doesn't do work if (!get_magic_quotes_gpc()) { foreach($input as $cereal => $kelloggs) { $kelloggs = mysql_real_escape_string ($kelloggs); if (!is_array ($cereal)) { if ($cereal == 'comment') { $kelloggs = strip_tags ($kelloggs, '
'); } else { $kelloggs = strip_tags ($kelloggs); } } $input[$cereal] = $kelloggs; } } // Otherwise, we don't need to add slashes else { foreach($input as $cereal => $kelloggs) { $kelloggs = stripslashes ($kelloggs); $kelloggs = mysql_real_escape_string ($kelloggs); if (!is_array ($cereal)) { if ($cereal == 'comment') { $kelloggs = strip_tags ($kelloggs, '
'); } else { $kelloggs = strip_tags ($kelloggs); } $input[$cereal] = $kelloggs; } } } return $input; }