Page 1 of 1
Submit my website form data to another website member form
Posted: Mon Jun 06, 2016 7:11 am
by MPie
So I have a simple form (attached) with Terms and conditions (with tick box to agree before continuing) and a button called ‘Submit'. When the terms have been agreed and the button clicked, I want to pull data from my WordPress member data on a MYSQL db and submit this data to another website member form (I will add several websites around the world which will no doubt have varying membership form data requirements). Then return a result page saying: “We are activating this and you will be receiving info shortly. Blah…
What's the best way/How would you do it in PHP? Does anyone have or can anyone come up with the best code to use for this? I'd like to test it.
Cheers.

Re: Submit my website form data to another website member fo
Posted: Mon Jun 06, 2016 6:55 pm
by requinix
Probably the best way is to simulate the form submission using something like cURL - you do it on the backend, not with an actual form on the frontend.
Re: Submit my website form data to another website member fo
Posted: Thu Jun 09, 2016 8:25 am
by MPie
Thanks requinix. I haven't used cURL so wouldn't know where to start. Is it easy enough? Any examples?
Re: Submit my website form data to another website member fo
Posted: Thu Jun 09, 2016 7:11 pm
by requinix
cURL is fairly simple to use. You just set a number of options for what you want to do: option to GET or POST, option to include form data, option to return whatever response the other server says (because it outputs by default)... The
basic example that shows what the code looks like, and all the options are documented with
curl_setopt. Also check the user comments to see what other people have said about it.
Re: Submit my website form data to another website member fo
Posted: Sun Jun 12, 2016 3:45 am
by MPie
Cool, thanks requinix, not sure I can do this, I could do with an example so I can tinker with it.