I have a form (on domain 1) that is currently being submitted to a different domain (domain 2) via PHP cURL functions. The need to send some of the data to a DIFFERENT domain (domain 3) has caused me some confusion.
Basically I was thinking of using a hidden form that will echo some of the input's values (form submitted to domain 2) and submit to "domain 3". Is there a better way to do this? Possibly the curl_multi functions?
The main (non-hidden) form is开发者_开发百科 utilizing via jquery's AJAX functions. Is there a way to make 2 form submissions utilizing this?
I'm not entierly sure what you are trying to do but I will make a guess.
You have one page that submits to your domain.
The receiving php page then resubmits this data to domain2.
Now you need some of the data to be submitted to domain3 to?
As you cannot post 2 forms at once you either have to make 2 posts from the client, one for each target domain, using ajax.
The other solution I would use is have some extra hidden field mapping which fields that should be submitted to which domain.
This could contain either a JSON string or any other format that can list domains + an array for each domain with the fields.
Ex:
<input type="hidden" name="fieldmap" value='[{"domain":"domain2,"fields":["fields1","field2","field3"]},{"domain":"domain3,"fields":["field3"]}]'>
The field example should be escaping the " inside the value attribute as "" but for readability I have not none this.
精彩评论