function gbHandler($p) { $session = SessionHandler::getInstance(); if ($session->id == $p['to']) { return false; } $gb = new Guestbook(); $gb->owner = $p['to']; $gb->creator = $session->id; $gb->time_created = sql_datetime(time()); $gb->body = $p['body']; $gb->store(); return true; }