Hi all,
I have a script like this:
in html
<form name="form" action="process.php" method="post"> <input name="type[]" type="checkbox" id="type[]" value="1" checked> <input name="type[]" type="checkbox" id="type[]" value="2" > <input name="type[]" type="checkbox" id="type[]" value="3" > <input name="type[]" type="checkbox" id="type[]" value="4" > <input name="type[]" type="checkbox" id="type[]" value="5" > <input type="text" name="xyz"> <input type="submit" name="Submit" value="GO"> </form>
and in process.php I have:
<?php
function stripTags($value){ if(isset($value)) return strip_tags($value); }
if(isset($_POST)){
foreach($_POST as $key=>$value){
$_POST[$key] = trim($value);
$_POST[$key] = stripTags($value) ;
}
}
Both trim and stripTags take a string as an argument and return a string. So each $value is converted to a strig, if you look into the manual, if an array is converted to a string the result is "Array".
You need a recursive function that takes an array as an argument and trims and striptags every element of the array, unless the element is an array itself, in this case it calls itself with the array element as the argument.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php