Forum Moderators: coopster
Most of the values worked
such as: ss_agerangelow is 18
But then I have some check box and other multiple answer elements:
ss_social_situation is Array
I tried doing this:
print_r($_POST);
if ($_POST) {
foreach (array_keys($_POST) as $key) {
$$key = $_POST[$key];
if (is_array(${$key})){
foreach (array_keys(${$key}) as $key2) {
$$key2 = $_POST[$key2];
print "$key2 was part of array $key = ${$key2}<br />";
}
}
else{
print "$key is ${$key}<br />";}
}
}
But that didn't work.
My goal is to get the post array values into my database. I also need to do some validation and sql injection protection stuff in between right?
if ($_POST) {
foreach (array_keys($_POST) as $key) {
$$key = $_POST[$key];
if (is_array(${$key})){
foreach(${$key} as $key2){
$$key2 = $_POST[$key2];
print "$key2 was part of array $key = $key<br />";
}
}
else{
print "$key is ${$key}<br />";}
}
} New to the Area was part of array ss_social_situation = ss_social_situation
So now what should I do to filter and check this stuff before putting it in my DB?