-2

I have a question, is possible to send data from an other host in an input of another host?

For example, my host is www.example.com and i wanna send data to an input from the host called www.example2.com. Is it possible with PHP, Python, JavaScript?

DeFabregas
  • 49
  • 5

3 Answers3

0

it's possible simply just add action to the domain this in your form

<form action="http://someotherdomain.com">

or via ajax sample code with button submit

<script>
   $(document).on("click", "#yourbtnSubmitId", function(e) {
      $.ajax({

          type: 'POST',     
          data: $("form").serialize(),
          url: 'http://someotherdomain/anotherpage',  
            success: function(res) {
               alert("done");
            }   

        });

<script>

here more helpful reference

hope this help you

Community
  • 1
  • 1
Faisal Arkan
  • 139
  • 2
  • 6
0

it is very possible to send the data to a different host, however you have to call to that server in your connect db statement; for example your other host is mysql.server2.com , you may include the following in your current host db connect file.

$link = mysql_connect("mysql.server2.com", "username", "password")
      or die("Could not connect");
        $db = mysql_select_db("your_db", $link)
    or die("Could not select database");

however, from practice, I would not recommend this method since one server may be experiencing downtime which will affect the other.

-1

Yes, you can send data to another host from your site. You can do this by following ways-

  1. For PHP - It is done cURL. Refer this link

  2. For Javascript - Simply by ajax call. Refer this link

Shubham
  • 1,163
  • 2
  • 12
  • 36