Hi, I have a contact form on my site that uses conditional logic to display one of many state county dropdowns depending on what state the user selects in a state pulldown. We need to pass this data to a third party site and I'm using the gform_after_submission function, which works great. But I'm not sure how to add all these county fields to the function, where my variable "county" could equal $entry[9], $entry[10], or all the way up to $entry[59]! Can someone help me figure out how to format this variable in the function? I thought it might be with an array but that doesn't work. I just don't know how to assemble everything, here's my code that isn't working-- I see the $county array when I print_r the fields, but it's not passing to the third party site. (I've changed the $post_url here for privacy)
function post_to_third_party($entry, $form) {
$post_url = 'Our Third Party Site';
$county = array($entry['9'],$entry['10'],$entry['11'],$entry['12'],$entry['13'],$entry['14']);
$body = array(
'namefirst' => $entry['1'],
'namelast' => $entry['2'],
'zip' => $entry['3'],
'email' => $entry['4'],
'phone' => $entry['5'],
'loanamt' => $entry['6'],
'propvalue' => $entry['7'],
'state' => $entry['8'],
'county' => $county
);
$request = new WP_Http();
$response = $request->post($post_url, array('body' => $body));
print_r($post_url);
}