Note that there are some explanatory texts on larger screens.

plurals
  1. POSend php form to 2 locations
    primarykey
    data
    text
    <p>What is the best/easiest way to send information from a form to two different locations, basically have 2 actions on one form. I have a few fields that need to be named differently for each action, for example..</p> <pre><code>&lt;form id="form" name="form" action='post.php' method='POST' accept-charset='UTF-8'&gt;&lt;input type='hidden' name='xnQsjsdp' value=SlGqwqH3ITc$/&gt; &lt;input type='hidden' name='xmIwtLD' value=x4LHs39QfKiFkCs1PrsnsG-*B6-MHnNR/&gt; &lt;input type='hidden' name='actionType' value=TGVhZHM=/&gt; &lt;input type='hidden' name='returnURL' /&gt; &lt;input name='firstName' type='text' id="firstName" style="float:left; width:45%;" maxlength='40' /&gt; &lt;input name='lastName' type='text' id="lastName" style="float:left; width:45%;" maxlength='40' /&gt; &lt;input type="submit" /&gt; &lt;/form&gt; </code></pre> <p>post.php look like this.</p> <pre><code>&lt;?php if ($_SERVER['REQUEST_METHOD'] == "POST") { $hidden1 = $_POST["xnQsjsdp"]; $hidden2 = $_POST["xmIwtLD"]; $hidden3 = $_POST["actionType"]; $hidden4 = $_POST["returnURL"]; $firstName = $_POST["firstName"]; $lastName = $_POST["lastName"]; $street = $_POST["Street"]; $city = $_POST["City"]; $State = $_POST["State"]; $zipCode = $_POST["Zip"]; $email = $_POST["Email"]; $phone = $_POST["Phone"]; $LEADCF7 = $_POST["LEADCF7"]; $zohoPrams = "xnQsjsdp=$hidden1&amp;xmIwtLD=$hidden2&amp;actionType=$hidden3&amp;returnURL=$hidden4&amp;First Name=$firstName&amp;Last Name=$lastName"; $maxPrams = "FName=$firstName&amp;LName=$lastName"; }; ?&gt; </code></pre> <pre><code>&lt;script&gt; $(function() { // setup an onReady (similar to onLoad) handler $.post("https://crm.zoho.com/crm/WebToLeadForm", &lt;?php echo $zohoPrams; ?&gt;; // post to first address $.post("http://www.max360group.com/", &lt;?php echo $maxPrams; ?&gt;; // post to second address }); &lt;/script&gt; </code></pre> <p>as you can see i tried using ajax.. but i guess i'm doing something wrong, if you have any suggestions to do this any other way that would be great :] Thank you!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload