任何人都可以看到我的代码有什么问题吗?
我正在尝试为 $_POST 中的每个事件创建一个日历事件。应该有一个日历可供下载,其中包含多个事件。
到目前为止,它将生成一个日历文件以供下载,其中仅包含列表中的最后一个事件。它覆盖了旧的。
提前感谢您的帮助。
//Set the headers
header("Content-Type: text/Calendar");
header("Content-Disposition: inline; filename=calendar.ics");
//Loop through $_POST to get all entries
foreach ($_POST['listItem'] as $value){
$dave = trim($value);
echo "BEGIN:VCALENDAR\n";
echo "VERSION:2.0\n";
echo "PRODID:www.testMeiCalendar.net\n";
echo "METHOD:REQUEST\n"; // requied by Outlook
echo "BEGIN:VEVENT\n";
echo "DTSTART:".$dave."T230000\n";
echo "DTEND:".$dave."T010000\n";
echo "SUMMARY:This is beautiful\n";
echo "LOCATION:Downtown\n";
echo "DESCRIPTION:Let's get together for New Years Eve\n";
echo "UID:ABCD1234\n";
echo "SEQUENCE:0\n";
echo "DTSTAMP:20101125T112600\n";
echo "END:VEVENT\n";
echo "END:VCALENDAR\n";
}