$object->username = $_POST["username"]; $object->create(); } else { $object = LikedBoxSnap::get_by_id_username($_POST["boxsnapid"], $_POST["username"]); if ($object) { $object->delete(); } } $message = "success"; } else { if ($_GET['object'] == "boxsnapcomment") { $object = new BoxSnapComment(); $object->boxsnapid = $_POST["boxsnapid"]; $object->username = $_POST["username"]; $object->comment = $_POST["comment"]; $object->create(); $message = "success"; } else { if ($_GET['object'] == "wallpostcomment") { $object = new WallPostComment(); $object->boxsnapid = $_POST["wallpostid"]; $object->username = $_POST["username"]; $object->comment = $_POST["comment"]; $object->create(); $message = "success"; } else { $message = "Object Specified Does Not Exists"; } } } }