title: How to send a $_POST data to another server?
body: <p>How do I send a data contained in a $_POST request to another server? 
  Here's my php file</p>
  
  <pre><code>&lt;?php
  if(isset($_POST['submit'])){
      $name = $_POST['name'];
      $email = $_POST['email'];
      $contact = $_POST['contact'];
      $address = $_POST['address'];
      $ip = $_SERVER['REMOTE_ADDR'];
      if($name !=''&amp;&amp; $email !=''&amp;&amp; $contact !=''&amp;&amp; $address !='')
      {
          header("Location:http://example.com/loginsuccess/");
      }
      else{
          ?&gt;&lt;span&gt;&lt;?php echo "You must fill out all the fields";?&gt;&lt;/span&gt; &lt;?php
      }
  }
  ?&gt;
  </code></pre>
  
  <p>Like if I wanted <code>$ip</code> to be logged then how do I add that to another server? Like for example if my domain is example.com then I want the <code>$ip</code> log to go on myexample.com. I do not know how to do this and I've spent so long trying and experimenting on how to do this but I can't figure it out, so that's why I'm here on stackoverflow </p>