Submit my website form data to another website member form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
MPie
Forum Newbie
Posts: 4
Joined: Mon Jun 06, 2016 6:38 am

Submit my website form data to another website member form

Post 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.
:banghead:
Attachments
Screen Shot 2016-06-06 at 12.36.12.png
Screen Shot 2016-06-06 at 12.36.12.png (18.1 KiB) Viewed 3915 times
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Submit my website form data to another website member fo

Post 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.
MPie
Forum Newbie
Posts: 4
Joined: Mon Jun 06, 2016 6:38 am

Re: Submit my website form data to another website member fo

Post by MPie »

Thanks requinix. I haven't used cURL so wouldn't know where to start. Is it easy enough? Any examples?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Submit my website form data to another website member fo

Post 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.
MPie
Forum Newbie
Posts: 4
Joined: Mon Jun 06, 2016 6:38 am

Re: Submit my website form data to another website member fo

Post by MPie »

Cool, thanks requinix, not sure I can do this, I could do with an example so I can tinker with it.
Post Reply