1 回答

TA貢獻1876條經驗 獲得超5個贊
我已經弄清楚了。我只是將它包含在我的循環語句的底部并添加了一個 save.php 文件。將此用作參考https://www.studentstutorial.com/ajax/insert-data
$.ajax({
url: "save.php",
type: "POST",
data: {
fname: hid1,
lname: hid2,
gender: hid3,
hour: hid4
},
cache: false,
success: function(dataResult){
var dataResult = JSON.parse(dataResult);
if(dataResult.statusCode==200){
alert("Save Successful!");
}
else if(dataResult.statusCode==201){
alert("Error occured !");
}
}
});
- 1 回答
- 0 關注
- 92 瀏覽
添加回答
舉報