Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've edited your code slightly to add a CURLOPT_RETURNTRANSFER, that way you can receive the output of remote server as a response from the curl_exec() function. Another thing i did is to change the $sender and $receiver vars with the appropriate $_POST array indexes. Last change is that i changed the CURLOPT_POSTFIELDS directive to receive an array.</p> <p>The code runs fine and the response is as expected: Just paste this into some new file and load in browser and try for yourself.</p> <pre><code> &lt;?php if($_POST) { $ch = curl_init("http://jecom.nl/jecom/curl/receive.php"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, array('sender' =&gt; $_POST['sender'], 'receiver'=&gt; $_POST['receiver'])); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); // HERE YOU GET THE RESULT OF THE REQUEST AS A STRING if (curl_errno($ch)) { print curl_error($ch); } else { curl_close($ch); } var_dump($result); } ?&gt; &lt;form method="POST" action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;" name="login"&gt; &lt;table width="100%"&gt; &lt;tr align="center"&gt; &lt;td width="50%" align="right"&gt;&lt;font color="navy"&gt;Sender&lt;/font&gt;&lt;/td&gt; &lt;td width="50%" align="left"&gt;&lt;input type="text" name="sender" size="50"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr align="center"&gt; &lt;td width="50%" align="right" width="100"&gt;&lt;font color="navy"&gt;Receiver&lt;/font&gt;&lt;/td&gt; &lt;td width="50%" align="left"&gt;&lt;input type="text" size="50" name="receiver"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr align="center"&gt; &lt;td width="50%" align="right" width="100"&gt;&lt;font color="navy"&gt;Amount&lt;/font&gt;&lt;/td&gt; &lt;td width="50%" align="left"&gt;&lt;input type="text" size="50" name="amount"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr align="center"&gt; &lt;td colspan="2" align="center"&gt;&lt;input name="submit" type="submit" value="Inloggen"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; </code></pre> <p>I also got the response upon the submit :</p> <p>string(41) "Greetings, visitor from 84.229.122.167me"</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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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