所有PHP的, 說我有下面的代碼位:值傳遞給jQuery的POST
select: function(start, end, allDay) {
var title = prompt('Event Title:');
if (title) {
calendar.fullCalendar('renderEvent',
{
title: title,
start: start,
end: end,
allDay: allDay
},
true // make the event "stick"
);
alert(start);
jQuery.post("save_calendar_event.php", {
title: title,
start: start,
end: end,
allDay: allDay
}, function(data){
alert(data);
});
}
calendar.fullCalendar('unselect');
}
然後,我有一個PHP頁面來接受這個職位值:
$title = $_POST['title'];
$start_time = $_POST['start'];
echo "The start time is: ".$start_time;
如果我回顯$標題它的工作正常,但如果我做$ start_time它說價值不存在。當警報顯示在jQuery端的開始時,它有我想要傳遞的數據。爲什麼不把它傳遞給我的PHP頁面?
編輯:如果我做了我的警報警報顯示:太陽2012年1月29日12:00:00 GMT-0600(中部標準時間)
謝謝!
使用瀏覽器的網絡監視工具來檢查發送到您的PHP腳本的POST參數。開始設置是否正確? – Phil 2012-02-01 02:48:44
在你的php中,做一個'print_r($ _ POST)'。也許你的'start'變量被索引的方式不同,那麼你認爲。 – 2012-02-01 02:48:57
它說「價值不存在」?沒有,它究竟說了什麼?另外,'var_dump($ _ POST)'給你什麼? – deceze 2012-02-01 02:49:05