i have a problem. I want to mask via mysql_real_escape_string all $_POST Variables (include $_POST array). The Script mask only $_POST['das'] and no $_POST[template_id] (its empty)
How can i mask $_POST[template_id]?
<?php
$dbcon = mysql_connect('localhost', 'xxx', 'xxx') or 
exit(mysql_error());
mysql_select_db('xxx', $dbcon) or exit(mysql_error());
function your_filter($value) {
$newVal = trim($value);
$newVal = mysql_real_escape_string($newVal);
return $newVal;
}
foreach($_POST as $key => $value) {
$_POST[$key] = your_filter($value);
}
?>
    <form action='' method='post'>
    <input type='checkbox' class='flat' name='template_id[]' value='"2'>A<br>
    <input type='checkbox' class='flat' name='template_id[]' value='3'>B<br>
   <input type='text' class='flat' name='das' value='"test'> b<br>
   <input type='submit'>
   </form>
