【发布时间】:2011-11-14 15:32:37
【问题描述】:
我正在使用以下 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);
}
});
问题是为什么我仍然没有得到任何回复?
【问题讨论】: