Google日历功能在传递唯一id后删除我的所有事件


Google calendar function deletes all my events after passing unique id

Google Calendar的delete function从Google日历中删除了我的所有事件,我不知道为什么会发生这种情况。任何帮助都会很感激。我在删除锚中调用了deleteevent函数。

$id = 'unique event id';
<a href="<?php $this->deleteevent($id);?>">Delete</a>    
function deleteevent()
{
    $cal->events->delete('primary', $id1) 
}

你还没有定义你的函数与传入事件和你回调到谷歌使用$id1。

你需要把你的代码修改成这样一点

$id = 'unique event id';
<a href="<?php deleteevent($id);?>">Delete</a>    
function deleteevent($inboundid)
{
    $cal->events->delete('primary', $inboundid) 
}

然而,这不会在点击删除链接工作,它只会执行函数的每一个页面加载。你需要某种形式的事件来调用函数的链接点击,它是一个get/post或ajax查询。

也不需要在里面加上$this->除非所有的代码都在一个类里面