Forum Moderators: coopster

Message Too Old, No Replies

Submit 1 form on 2 locations.

how?

         

robix

8:16 pm on Nov 29, 2007 (gmt 0)

10+ Year Member



Is it possible to submit 1 form on 2 sites ...? For example; when user types his "name" and "last-name" in the form and clicks submit button.. it first gets submitted to main site and then the same data gets submitted to an external site which is having same "name" and "last-name" as an input box and a submit button....

coopster

8:50 pm on Nov 30, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, robix.

Yes, it is. The first site would accept the form submission and become the main process handler. You can open a socket connection to the second site and post the data there and read the response back from that second site within the originating site's form response handler.

There is a short example in our PHP Forum Library that describes a Single form posted to multiple locations [webmasterworld.com]

Demaestro

9:03 pm on Nov 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This can also be done with an Ajax post as well.

Submit the form via Ajax then the action of the form..

Something like this.......

<form NAME="the_form" id="othe_form" METHOD="POST" ACTION="/action.php"
onsubmit="AjaxPostMethod({method:'post', url:'/index.py'});">