POST data from my site to another form on different website using PHP?

DeWire

New member
I understand how to use PHP to post data from an html form to a php file where it can be, ie , sent to a specific email address.

But how can I post data from a form on my site to a form on ANOTHER website where it can be handled there ?

Thanks for your time,
Dave
Cheers for your response Richard but I dont think you understand me , apologies.

I have my site (siteA) with a HTML form.
I want that form to post the data into siteB which also has a html form. then the HTML form on siteB will process the data obviously in a way I wont be able to control, but that wont matter.

Does that make sense ?

Thanks,
Dave
 
In your HTML form just change the "action". For example say this is the script you have now:

<form action="mysite.com/action.php" method="POST">
...
</form>

You would change it to:

<form action="theirsite.com/action.php" method="POST">
...
</form>

You might have to change the "POST" to "GET" if it is pulling the parameters from the url.
 
If i'm understanding your question correctly- you just need to change the action="suchandsuchsite" in the html form. You can write custom forms for other sites- just keep in mind the ids of the input fields.

edit: oh, and keep in mind that if you're looking at the source of the other site's form, then the action="/folder/thispage.php" is most of the time relative. You need to copy it as action="http://www.somesite.com/folder/thispage.php"
 
Back
Top