I have a form on a WordPress website that sends form input data to Pardot where their prospect account is created. The data is then sent back to the website and caught by user_reg.php where their user account is created for the site. The current form action looks like this:
<form action="pardot.com">
I have some code I wrote that filters out bots the user_reg.php, but it only works on the website and their account is still created in Pardot since it is sent there first.
I need to figure out how to send the form data to user_reg.php, run the bot filtering code, create the website account or (if they're a bot) redirect them to the homepage, then after they're determined not to be a bot and their website account is created send the information to Pardot to create their Pardot account.
form.php
<form action="user_reg.php" method="post" id="main_form" name="main_form">
<table>
<tr><td><input type="text" maxlength=25 placeholder="Username" id="username" name="username"/></td></tr>
<tr><td><input type="password" maxlength=25 placeholder="password" id="password" name="password"/></td></tr>
<tr><td><input type="text" id="brokerdealer" name="brokerdealer" placeholder="Broker Dealer / Company"/></td></tr>
<tr><td><button type="submit" id="sbmt_btn" name="submt_btn">Send</button></td></tr>
</table>
user_reg.php
// Data validation and blacklist code. If they are determined to be a bot then redirect
// them to homepage. If they are not a bot then proceed to register the user.
if(isset($_POST['submt_btn'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$broker = $_POST['brokerdealer'];
}
// Code to register user in database
// After registering the user, send form data to Pardot
header('location: registration_confirmation.php');
How can I pass the data from user_reg.php which registers the user on the website to pardot.com which creates their prospect account?