Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Making sure that I understand-</p> <p>do you want one server to receive the results of your forum while you get redirected to a separate server?</p> <p>The only practical reason I could imagine for that setup would be a phishing scam, but assuming you have honorable intentions in mind, you have a few options.</p> <p>Submit the form to abc.com, then have abc.com process the variables and send a redirect header to send the user back to xyz.com. This method requires you own web space on both abc.com and xyz.com for creating the form and for processing the form.</p> <pre><code>xyz.com: &lt;form action="abc.com/..." method="get"&gt; &lt;input type="text" name="value" /&gt; &lt;input type="submit" /&gt; &lt;/form&gt; abc.com: &lt;?php /* Do something with $_GET["value"] */ header("Location: xyz.com"); ?&gt; </code></pre> <p>Use AJAX to submit the form contents to abc.com while submitting the form to xyz.com (I'm not comfortable enough with javascript to provide the source for this)</p> <p>Have xyz.com submit the values to abc.com</p> <pre><code>&lt;?php $output = file_get_contents("abc.com?value=".$_GET["value"]); ?&gt; </code></pre> <p>You could also create a stream_context to send the POST to another server.</p> <pre><code>&lt;?php $context = stream_context_create(array( 'http' =&gt; array( 'method' =&gt; 'POST', 'header' =&gt; "Content-type: application/x-www-form-urlencoded\r\n", 'content' =&gt; http_build_query(array('value' =&gt; $value)), 'timeout' =&gt; 90, ), )); $ret = file_get_contents('abc.com', false, $context); ?&gt; </code></pre> <p>Or, a 307 redirect (temporary redirect) should send POST data.</p> <pre><code>&lt;?php header("HTTP/1.0 307 Temporary Redirect", $replace=true, 307); header("Location: xyz.com"); ?&gt; </code></pre>
 

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