$result = mysql_query($query); $data = array(); if (is_resource($result)) { while ($row = mysql_fetch_array($result)) { $data[] = $row; } } echo json_encode(array($data[0])); exit; } if (isset($_GET["action"])) { if ($_GET["action"] == "register") { action_register(); } if ($_GET["action"] == "login") { action_login(); } if ($_GET["action"] == "logout") { action_logout(); } if ($_GET["action"] == "updatepass") { action_updatepass(); } if ($_GET["action"] == "ajaxrefresh") { echo action_ajaxrefresh(0); mysql_terminate(); exit; } if ($_GET["action"] == "submitcode") { $rid = action_submitcode(); }
/* includes */ require "inc/setup.inc.php"; require "inc/actions.inc.php"; require "inc/session.inc.php"; require "inc/modules.inc.php"; require "inc/mysql.inc.php"; require "inc/output.inc.php"; header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); ses_start(); sql_connect(); if (!action_checklogin()) { if (!action_login()) { action_redirect("login.php"); } } $mod = $_GET['m']; if ($mod) { ses_set("module", $mod); } else { $mod = ses_get("module"); } switch ($_GET['a']) { case 1: unset($mod); break; case 3: action_redirect($_GET['page']);