I'm trying to do co-registration, i.e. register on the original site first, then register the same form values to an external site.
I am looking for a clear way to do it, but without displaying an additional form with the values already populated.
I could get the form values from the original form using the following, but I am not sure it is the best way of doing it.
$.ajax({
type: 'POST',
dataType: 'JSON',
data: {param1: $('input#param1').val(), param2: $('input#param2').val()},
url: 'url to post to',
success: (your success callback function goes here)
})
Really I just wanted to know if there is another way, but since all I have from the other site is the URL to send the data, jQuery is the only way I can think of — just want to know if anyone has another way of doing it seamlessly, without jQuery?
Your situation is similar to the scenario in this tutorial: Execute a HTTP POST Using PHP CURL. Also see the first comment on that page which may or may not be relevent here:
Since you didn't give any details about your specific needs, I can't give any code that's relevant to your situation.