I've made a little application that uses Google Calendar API and Oauth2. Now I would like to allow user to answer at an event. This is my code:
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>
But It doesn't work, user's reponse status doesn't change when I'm submit the form. What's the problem?