Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.