I want to build a simple form which collect input value and send email. some input name are array, and I just couldn't get the value from these arrays. Below is the code.
$keysToKeep = array('CustomFields[6]', 'email');
$values = array_intersect_key($_POST, array_flip($keysToKeep));
print_r($keysToKeep);
foreach ($values as $name => $value)
{
$message .= $name . ': ' . $value . PHP_EOL;
}
HTML Code:
Your name:
<input type="text" name="CustomFields[6]" id="CustomFields_6_337" value="" fid="4" fname="Name" size='64' maxlength='64'>
Your Email Address:
<input type="text" class="email" name="email" fid="e" fname="Email" ftype="Email" reqd="1"/>