if (empty($query)) { exit; } $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; }
function register($login, $password, $repassword, $mail) { echo action_register($login, $password, $repassword, $mail); }