$message = "Menu order NOT updated. Try again in a few minutes."; } echo json_encode(array("message" => $message)); break; case 'login': unset($_POST['func']); echo (string) $pm->login($_POST['password']); if ($pm->login($_POST['password'])) { $_SESSION['l_o_g_g_e_d__i_n'] = true; } else { // Unset all of the session variables. $_SESSION = array(); // If it's desired to kill the session, also delete the session cookie. // Note: This will destroy the session, and not just the session data! if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time() - 42000, '/'); } // Finally, destroy the session. session_destroy(); } break; case 'load': $item = $pm->loadContent($_GET['id']); if ($item) { $message = "Content loaded."; } else { $message = "Content NOT loaded. Try again in a few minutes."; } echo json_encode(array('item' => $item, 'message' => $message)); break; }