Submissions show up in random fields


#1

This is admittedly a weird situation. My client requested a form with several fields that are very similar. It’s basically a set of 5 fields that are repeated 10 times. I’ve created a form in Hubspot to gather the input from each field individually, and I’m using the form API to construct the form outside of Hubspot, because of some special functionality. I’m using the PHP submission script.

When I submit the form, the results get mixed up in Hubspot. The entries from several fields will pile up into one or two different fields. Here’s a screenshot of the results:

I’ve made sure that the fields are unique and are mapped to unique fields in Hubspot.

Here’s a link to the test form, to get a better idea of the goal: http://freeformagency.com/brightview/associa/

Any ideas?

Thanks!


#2

Hi @Steve_Rhom

Do you have an example of the actual POST data being used in the submission requests? As long as each of the fields has a unique name, they should show up separately in HubSpot (I’m not able to see the screenshot you originally posted).


#3

@dadams The fields are set up in sets of 5, up to 10 levels. Here’s the post data. There’s quite a bit and PHP is not my native tongue, so apologies. I tried to keep everything straight, but you never know. These were originally meant to correspond to a gift card amount, but that’s been changed on the front end. Thanks for having a look!

if(isset($_POST['submit'])) {
	$firstname = $_POST["firstname"];
	$lastname = $_POST["lastname"];
	$email = $_POST["email"];
	
	$community_name = $_POST["community-25"];
	$city = $_POST["city-25"];
	$state = $_POST["state-25"];
	$rfp_date = $_POST["rfpdate-25"];
	$budget = $_POST["budget-25"];
	$upload_rfp = $_POST["rfp-upload-25"];
	
	$community_50_1 = $_POST["community-50-001"];
	$city_50_1 = $_POST["city-50-001"];
	$state_50_1 = $_POST["state-50-001"];
	$rfp_date_50_1 = $_POST["rfpdate-50-001"];
	$budget_50_1 = $_POST["budget-50-001"];
	$rfp_upload_50_1 = $_POST["rfp-upload-50-001"];
	
	$community_50_2 = $_POST["community-50-002"];
	$city_50_2 = $_POST["city-50-002"];
	$state_50_2 = $_POST["state-50-002"];
	$rfp_date_50_2 = $_POST["rfpdate-50-002"];
	$budget_50_2 = $_POST["budget-50-002"];
	$rfp_upload_50_2 = $_POST["rfp-upload-50-002"];
	
	$community_100_1 = $_POST["community-100-001"];
	$city_100_1 = $_POST["city-100-001"];
	$state_100_1 = $_POST["state-100-001"];
	$rfp_date_100_1 = $_POST["rfpdate-100-001"];
	$budget_100_1 = $_POST["budget-100-001"];
	$rfp_upload_100_1 = $_POST["rfp-upload-100-001"];
	
	$community_100_2 = $_POST["community-100-002"];
	$city_100_2 = $_POST["city-100-002"];
	$state_100_2 = $_POST["state-100-002"];
	$rfp_date_100_2 = $_POST["rfpdate-100-002"];
	$budget_100_2 = $_POST["budget-100-002"];
	$rfp_upload_100_2 = $_POST["rfp-upload-100-002"];
	
	$community_250_1 = $_POST["community-250-001"];
	$city_250_1 = $_POST["city-250-001"];
	$state_250_1 = $_POST["state-250-001"];
	$rfp_date_250_1 = $_POST["rfpdate-250-001"];
	$budget_250_1 = $_POST["budget-250-001"];
	$rfp_upload_250_1 = $_POST["rfp-upload-250-001"];
	
	$community_250_2 = $_POST["community-250-002"];
	$city_250_2 = $_POST["city-250-002"];
	$state_250_2 = $_POST["state-250-002"];
	$rfp_date_250_2 = $_POST["rfpdate-250-002"];
	$budget_250_2 = $_POST["budget-250-002"];
	$rfp_upload_250_2 = $_POST["rfp-upload-250-002"];
	
	$community_500_1 = $_POST["community-500-001"];
	$city_500_1 = $_POST["city-500-001"];
	$state_500_1 = $_POST["state-500-001"];
	$rfp_date_500_1 = $_POST["rfpdate-500-001"];
	$budget_500_1 = $_POST["budget-500-001"];
	$rfp_upload_500_1 = $_POST["rfp-upload-500-001"];
	
	$community_500_2 = $_POST["community-500-002"];
	$city_500_2 = $_POST["city-500-002"];
	$state_500_2 = $_POST["state-500-002"];
	$rfp_date_500_2 = $_POST["rfpdate-500-002"];
	$budget_500_2 = $_POST["budget-500-002"];
	$rfp_upload_500_2 = $_POST["rfp-upload-500-002"];
	
	$community_500_3 = $_POST["community-500-003"];
	$city_500_3 = $_POST["city-500-003"];
	$state_500_3 = $_POST["state-500-003"];
	$rfp_date_500_3 = $_POST["rfpdate-500-003"];
	$budget_500_3 = $_POST["budget-500-003"];
	$rfp_upload_500_3 = $_POST["rfp-upload-500-003"];
	
   //Process a new form submission in HubSpot in order to create a new Contact.

$hubspotutk      = $_COOKIE['hubspotutk']; //grab the cookie from the visitors browser.
$ip_addr         = $_SERVER['REMOTE_ADDR']; //IP address too.
$hs_context      = array(
    'hutk' => $hubspotutk,
    'ipAddress' => $ip_addr,
    'pageUrl' => 'http://freeformagency.com/brightview/associa/',
    'pageName' => 'Associa Gift Card'
);
$hs_context_json = json_encode($hs_context);

//Need to populate these variable with values from the form.
$str_post = "firstname=" . urlencode($firstname) 
    . "&lastname=" . urlencode($lastname) 
    . "&email=" . urlencode($email)
	. "&community-25=" . urlencode($community_name) 
	. "&city-25=" . urlencode($city) 
	. "&state-25=" . urlencode($state) 
	. "&rfpdate-25=" . urlencode($rfp_date) 
	. "&budget-25=" . urlencode($budget) 
	. "&rfp-upload-25=" . urlencode($upload_rfp) 
	. "&community-50-001=" . urlencode($community_50_1) 
	. "&city-50-001=" . urlencode($city_50_1) 
	. "&state-50-001=" . urlencode($state_50_1) 
	. "&rfpdate-50-001=" . urlencode($rfp_date_50_1) 
	. "&budget-50-001=" . urlencode($budget_50_1) 
	. "&rfp-upload-50-001=" . urlencode($rfp_upload_50_1) 
	. "&community-50-002=" . urlencode($community_50_2) 
	. "&city-50-002=" . urlencode($city_50_2) 
	. "&state-50-002=" . urlencode($state_50_2) 
	. "&rfpdate-50-002=" . urlencode($rfp_date_50_2) 
	. "&budget-50-002=" . urlencode($budget_50_2) 
	. "&rfp-upload-50-002=" . urlencode($rfp_upload_50_2) 
	. "&community-100-001=" . urlencode($community_100_1) 
	. "&city-100-001=" . urlencode($city_100_1) 
	. "&state-100-001=" . urlencode($state_100_1) 
	. "&rfpdate-100-001=" . urlencode($rfp_date_100_1) 
	. "&budget-100-001=" . urlencode($budget_100_1) 
	. "&rfp-upload-100-001=" . urlencode($rfp_upload_100_1) 
	. "&community-100-002=" . urlencode($community_100_2) 
	. "&city-100-002=" . urlencode($city_100_2) 
	. "&state-100-002=" . urlencode($state_100_2) 
	. "&rfpdate-100-002=" . urlencode($rfp_date_100_2) 
	. "&budget-100-002=" . urlencode($budget_100_2) 
	. "&rfp-upload-100-002=" . urlencode($rfp_upload_100_2) 
	. "&community-250-001=" . urlencode($community_250_1) 
	. "&city-250-001=" . urlencode($city_250_1) 
	. "&state-250-001=" . urlencode($state_250_1) 
	. "&rfpdate-250-001=" . urlencode($rfp_date_250_1) 
	. "&budget-250-001=" . urlencode($budget_250_1) 
	. "&rfp-upload-250-001=" . urlencode($rfp_upload_250_1) 
	. "&community-250-002=" . urlencode($community_250_2) 
	. "&city-250-002=" . urlencode($city_250_2) 
	. "&state-250-002=" . urlencode($state_250_2) 
	. "&rfpdate-250-002=" . urlencode($rfp_date_250_2) 
	. "&budget-250-002=" . urlencode($budget_250_2) 
	. "&rfp-upload-250-002=" . urlencode($rfp_upload_250_2) 
	. "&community-500-001=" . urlencode($community_500_1) 
	. "&city-500-001=" . urlencode($city_500_1) 
	. "&state-500-001=" . urlencode($state_500_1) 
	. "&rfpdate-500-001=" . urlencode($rfp_date_500_1) 
	. "&budget-500-001=" . urlencode($budget_500_1) 
	. "&rfp-upload-500-001=" . urlencode($rfp_upload_500_1) 
	. "&community-500-002=" . urlencode($community_500_2) 
	. "&city-500-002=" . urlencode($city_500_2) 
	. "&state-500-002=" . urlencode($state_500_2) 
	. "&rfpdate-500-002=" . urlencode($rfp_date_500_2) 
	. "&budget-500-002=" . urlencode($budget_500_2) 
	. "&rfp-upload-500-002=" . urlencode($rfp_upload_500_2) 
	. "&community-500-003=" . urlencode($community_500_3) 
	. "&city-500-003=" . urlencode($city_500_3) 
	. "&state-500-003=" . urlencode($state_500_3) 
	. "&rfpdate-500-003=" . urlencode($rfp_date_500_3) 
	. "&budget-500-003=" . urlencode($budget_500_3) 
	. "&rfp-upload-500-003=" . urlencode($rfp_upload_500_3) 
    . "&hs_context=" . urlencode($hs_context_json); //Leave this one be