Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If the form has a "redirect_link" field, couldn't you just include it there as a <code>GET</code> parameter?</p> <pre><code>&lt;input value="http://www.somesite.com/thankyou.php?zip=12345" type="hidden" name="redirect_link" /&gt; </code></pre> <p>You would need to add JavaScript to the zip code input so that when it updates, it also updates the hidden field.</p> <p>As you mention, another option would be to use PHP sessions, but since it would also require sessions, you're not going to gain anything over doing it in a hidden field (e.g. if people have session cookies disabled).</p> <p>A third option I could think of, if it's possible, would be to use your own form to submit the data to the third party site using cURL. This would obviously only work if the user does not need to do anything on the remote site:</p> <pre><code>$url = 'http://www.othersite.com/script.php'; $data = array( 'name' =&gt; $name, 'email' =&gt; $email, ... ); //set the url, number of POST vars, POST data curl_setopt($ch,CURLOPT_URL, $url); curl_setopt($ch,CURLOPT_POST, count($data)); curl_setopt($ch,CURLOPT_POSTFIELDS, http_build_query($data)); //execute post $result = curl_exec($ch); //close connection curl_close($ch); </code></pre> <p>And finally, quite often sites that will redirect the user back to your site will have the ability to automatically append certain things to the return URL or send POST data to it. Check with the API of the site you are using has this ability. If so, this would probably be the easiest and best way to do it.</p>
 

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