0

Is here any way to send information to two url with the same form using get of post method at one time?Please suggest me?

3
Contributors
6
Replies
7
Views
5 Years
Discussion Span
Last Post by EvolutionFallen
0

get of post method at one time

Is that get or post?

Do you have control over either remote sites?

If not I suppose you could send GET to two iframes in the formhandler page - set the src values to the siteXurls and attach the querystring to each. It's not elegant and I haven't tried it but I assume it should work.

Else you could use cURL on POST data.

Here's a cURL example:

http://davidwalsh.name/execute-http-post-php-curl

However, he does use extract() on $_POST data - not something I'd recommend.

Edited by diafol: n/a

0

I've never tried it before, but can't this be done easily with JS? Use AJAX to submit the form once, then either use a callback function to submit again, or let the form continue processing and go to the action page?

EDIT:
To be fair though I suppose using PHP is better in case the user has JS disabled or is using a non-JS browser.

Edited by EvolutionFallen: had a change of heart ;)

0

If using ajax/js - you must use a cross-domain solution. I'm not sure that a vanilla jQuery ajax routine will work with remote sites.

1

True, though the OP didn't specify that he was interested in forwarding the data to remote sites. Not sure if "URL" refers to that, or if he just means two different pages/files.

Votes + Comments
Yep - my mistake. Thanks for pointing it out.
0

Yeah, fair comment EF, I just took it for granted for some reason that they were remote - and reading back there were no such statements. My bad.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.