Я использую следующий прокси-сервер PHP:
//Store the URL
$jURL = $_POST['jURL'];
//Store the POST data
$jData = $_POST['post_data'];
//And let cURL work it's magic.
$ch = curl_init();
//Set the URL
curl_setopt($ch, CURLOPT_URL, $jURL);
//Enable POST data
curl_setopt($ch, CURLOPT_POST, true);
//Use the $pData array as the POST data
curl_setopt($ch, CURLOPT_POSTFIELDS, $jData);
//curl_exec automatically writes the data returned
$response = curl_exec($ch);
curl_close($ch);
echo $response;
и звоню по следующему адресу:
var dataString = { 'Contact': Contact, 'address1': address1, 'address2': address2, 'city': city, 'state': state, 'zip': zip, 'Phone1': primPhone, 'Phone2': secPhone, 'email': email,
'key2': key2, 'key5': key5, 'uhsgradyr': uhsgradyr, 'uhighlevel': uhighlevel, 'ucourseint': ucourseint, 'uCampaignID': uCampaignID, 'utextperm':utextperm,
'uleaddate': uleaddate, 'uleadtime':uleadtime};
var postData = {jURL: 'http://test.com/candidate_test.php', postData: dataString};
$.ajax({
type: "POST",
url: "proxy.php",
data: postData,
success: function(data) {
window.location = "thankyou.php";
},
error:function(xhr, ajaxOptions, thrownError){
console.log(xhr.responseText);
}
});
Проблема заключается в том, почему я до сих пор не получаю ответ?