Jump to content

How to send data from one server to another server


ravemanhattan

Recommended Posts

Hi,

 

I am new to Ajax and I am stuck at a point where I have send the form details from one sever (html form) to another server(php file).

 

I am using Ajax for posting the data till now to the server, but is it possible to use Ajax to send data from one server to another server.

 

Please suggest me some techniques that can be used to work through this application.

 

I would really apprecaite any suggestions regarding this issue.

 

Thanks,

ravemanhattan.

 

  • 2 weeks later...

Yes you can do this. If you wanted to process the form data on another server then the form action parameter would simply point at the page i.e.

<form action="http://www.xyz.com/process.php" method="post">

 

However if you want to do it with ajax then I suggest the accepted method on the remote server is GET so:

// Ajax method
req.open("GET", http://www.xyz.com/process.php?var1="+val1+"&var2="+val2);

With this method you can also store the data on both servers with a second ajax request whereas using the using the form action parameter will send a user to the remote server. You would have to redirect them back.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.