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) ;
}
}
print "<pre>" ;
print_r($_POST);
print "</pre>" ;
?>
and the output will be :
Array
(
[type] => Array
[xyz] =>
[Submit] => GO
)
as you can see the type should be an array ... but it just displaying
Array ....
if I remove strip_tags from my script it will work perfectly (it will
display the checkbox array) ...
can someone explain to me why this happen ? I just want to strip tags
every input the user entered ...
thanks
--
Best regards,
adwin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php