Ok, this question probably has been asked quite a number of times, but I am fairly new to this technology and am not sure of what I should search for. So, if someone could either point me to a link where it has already been answered or provide the answer here, I would appreciate it.
Here is what I am trying to do.
On my web page, I have three choices for the user to pick from. After the user selects one of the checkboxes and clicks a submit button, I need to send a http request to a remote server to record the user's choices (actually it is an https that I am sending),.. so I need to send something like this.
So, I want to post the request, read the response (answer) back from the other server and display it on my page. So, my dilemma is as follows:
1) my understanding is that I cannot do this with AJAX using an XMLHttp object because it is on a remote server and it would violate some sort of same-domain security. Is that correct? If in fact I can do it in AJAX, how do I read the response back from the other server?
2) if I am correct in my assumption in 1) then what is the best way to accomplish this task?
Thanks in advance for any assistance anyone can provide.
You would setup a server-side script (using PHP or ASP or whatever your language is) that uses cURL or whatever your language uses to make and output the response. Then your AJAX call just points to your script.
`- Make request to RemoteServer.com/somefile.php
`- Output response from the request
`- Make request to myapifile.php