offsetTime)); } function loadForm() { $type = getMethod(); $id = ($type=='GET') ? $_GET['autosaveid'] : $_POST['autosaveid']; if(isset($_SESSION[$id])) echo $_SESSION[$id]; } function isLoad() { $type = getMethod(); if($type=='GET' and isset($_GET['autosave'])) return true; elseif(isset($_POST['autosave'])) return true; return false; } function getMethod() { return $_SERVER['REQUEST_METHOD']; } if(isAjax()) { if(isLoad()) loadForm(); else saveForm(); } exit; ?>