【发布时间】:2015-03-30 18:19:32
【问题描述】:
我制作了一个使用 Google Calendar API 和 Oauth2 的小应用程序。 现在我想允许用户在活动中回答。这是我的代码:
PHP
if(isset($_POST['submit'])){
$eventSubmit = $service->events->get('primary', $_POST['eventID']);
$attendeesSubmit=$eventSubmit->getAttendees();
foreach ($attendees as $attendee) {
$mailSubmit = $attendee->getEmail();
if ($mailSubmit==$emailUser){
if ($_POST['status']=='accepte'){
$attendee->setResponseStatus('accepted');
$service->events->update('primary', $_POST['eventID'], $eventSubmit);
}
if ($_POST['status']=='decline'){
$attendee->setResponseStatus('decline');
}
}
}
HTML
<form method="post" action="index.php">
<input type="radio" name="status" id="accepte" value="accepte">Confirmer</input>
<input type="radio" name="status" id="decline" value="decline">Décliner</input>
<input type="hidden" name="eventID" value="<?php echo htmlspecialchars($event['id']); ?>">
<input type="submit" name="submit" value="OK"></br></br>
但它不起作用,当我提交表单时,用户的响应状态不会改变。有什么问题?
【问题讨论】:
-
请解释清楚您的问题?当受邀者接受邀请时,您没有收到通知吗?是这种情况,在您的日历设置中将remindOnRespondedEventsOnly 更改为true。检查此链接developers.google.com/google-apps/calendar/v3/reference/…
-
不,我创建了一个小表单,在该表单中,对于他被邀请的每个事件,用户可以选择一个答案:接受或拒绝。但是,当我提交表单时,用户的答案在这个事件中没有改变,我不明白为什么