in stead of using array_map, you will have to fallback to writing your own code, and checking if you are facing an array inside the $_POST array.
if (isset($_POST))
foreach($_POST as $key=>$val)
if (is_array($val))
foreach($val as $key2=>$val2)
$_POST[$key][$key2] = trim($_POST[$key][$key2]);
else
$_POST[$key] = trim($_POST[$key]);
And to retain the selections after a failed page submit, you need to change:
echo "selected=\"selected\"";
into
if (isset($_POST) && isset($_POST['special']) && is_array($_POST['special']))
foreach($_POST['special'] as $key3=>$val3)
if (trim($row_climbingSpecial['climbingspecial']) == trim($val3))
{
echo "CHECKED=\"CHECKED\""; // it's 'checked', not 'selected' for check box.
break;
}
And by the way, you also need to change
echo "<option value=\"$row_climbingSpecial[climbingspecial]\"";
into
echo "<option value=\"{$row_climbingSpecial['climbingspecial']}\"";
the apostrophes '
prevent notices about undefined constants being taken for a string and the braces {}
allow earlier versions of php to recognizing the called array key inside the variable.