0

I posted this yesterday, and got a lot of helpful advice that uncovered numerous mistakes I made. I've fixed those, but the problem still persists, so here's an updated version of the question.

I'm trying to set up a Pardot form handler to run from a thank-you page, as is done in this example. I cannot just add the form action with the form handler address like you normally do, as the original form has to send the information to a third-party site. To date, I haven't been able to get that to work at all. I now know my biggest problem was that I was trying to run PHP from an HTML page, which will never work. So I have changed to a PHP page, but it's still not firing.

Here's the code:

    <?php  
$FirstName = $_POST['FirstName'];
$LastName = $_POST['LastName'];
$Email = $_POST['Email'];
$PayFrequency = $_POST['PayFrequency'];
$Phone = $_POST['Phone'];
$donationAmount = $_POST['donation-amount'];
$MailingStreet = $_POST['MailingStreet'];
$MailingCity = $_POST['MailingCity'];
$MailingState = $_POST['MailingState'];
$MailingPostalCode = $_POST['MailingPostalCode'];

echo '<iframe src="https://go.realurlhere.com?FirstName='.$FirstName.'&LastName='.$LastName.'&Email='.$Email.'&PayFrequency='.$PayFrequency.'&Phone='.$Phone.'&donationAmount='.$donation-amount.'&MailingStreet='.$MailingStreet.'&MailingCity='.$MailingCity.'&MailingState='.$MailingState.'&MailingPostalCode='.$MailingPostalCode.'" width="1" height="1"></iframe>';
?>

The matching field names are correct, as I named the external field names after the field names in the original form. (The one different one, donationAmount, I changed because I discovered PHP wouldn't read it correctly with the dash).

  • Question: Is this code being embedded in the Thank You page? Can we assume your third party submission is successful? Also, what is the submission method used in your original form? (GET or POST)? the snippet you copied is directly from Pardot Support, but It may not be the correct way for you to grab the field values. – Amjo Aug 18 '22 at 10:05
  • 1. Yes, the code is being embedded in the Thank You page. 2. Yes, the third-party submission is successful. It's an out of the box app added to Salesforce (no, I cannot just map the information from that app to Pardot; we have the cheapest Pardot license and custom object mapping isn't available) 3. Submission method in the original form is GET. Would changing it to POST help? – YankeeDave Aug 19 '22 at 00:13
  • Hi, Sorry for the late reply. The last part regarding GET/POST, it will help yes. Either change the form to POST (make sure the third party submission also expects POST), ORRR the easier solution is to change $_POST to $_GET. your sending values via get, but this script is checking for POST method. ALSO, dont forget to sanitize your variables. dont use raw $_GET / $_POST values – Amjo Aug 22 '22 at 12:15
  • Exactly what do you mean by "sanitize your variables"? The variables you see in brackets above after the $_POST's are the correct names of the input fields in the form. Do I need to change anything there? Thanks for the help so far! I'm switching the Posts to Gets now. – YankeeDave Aug 24 '22 at 00:57

0 Answers0