-1
我有以下jQuery代碼將數據發佈到php文件,並在本地主機上正常工作。但是,當此代碼現在在服務器上時,腳本將返回錯誤而不是數據。Jquery Ajax沒有在服務器上工作,但在本地主機上工作
$.ajax({
type: 'POST',
url: 'scripts/info.php',
data: {
accountNumber: accountNumber,
agentName: name
},
success: function(data) {
alert(data)
},
error: function(xhr, status, error) {
// check status && error
alert(status)
}
});
這是在處理POST請求的PHP文件中的代碼:
$args0 = array(
'accountNumber' => $_POST['accountNumber'],
'dateReceived' => date("Y-m-d"),
'firstNames' => $_POST['agentName'] '
'regNumber' => $_POST['accountNumber'],
'surname' => $_POST['agentName']
);
try {
$client = new SoapClient(WSDL_URL, array(
'trace' => 1,
'exceptions' => true,
'connection_timeout' => 300));
$params = array(
'arg0' => $args0,
);
$client->__setLocation(WSDL_LOCATION);
$response = $client->upload($params);
$response = $client->__getLastResponse();
echo $response;
請幫
什麼是控制檯錯誤? – Perspective
沒有控制檯錯誤 – Deant
我一直在尋找解決方案,但我找不到任何解決方案 – Deant