I have a form that needs to be submitted to two separate URLs: one being a Google Spreadsheet to store the data and the other being an off-site ASP form handler script. When I set the form action to either URL it works perfectly. However, I need it to submit to both URLs then redirect to a simple success.html page. If they weren’t external scripts I could do so easily with AJAX (see article) but that isn’t an option because of cross domain issues. Here is my code:
<form name="apply-now-form" action="somescript.php" method="POST" id="apply-now-form" class="apply-now-form">
<label class="form-label" >Full Name</label>
<input name="FirstName" id="FirstName" type="text">
<input name="LastName" id="LastName" type="text" >
<label>Phone Number</label>
<input name="ResidencePhone" id="ResidencePhone" type="text" >
<label>Email Address</label>
<input name="EmailAddress" id="EmailAddress" type="email" >
</form>
The ASP script handles the success redirect so I reckon it should be submitted to that one second. Is there a way, using cURL or otherwise, to send unaltered form data to multiple URLs using PHP? Or Javascript if that’s an option? Thanks.
You could perform this with CURL.
2- Send the data to Google:
3- Send the data to the ASP:
4- Redirect
I think that’s all.