get_info($_COOKIE["token"]); } switch ($_POST["function"]) { case 'change-pw': $user->change_password($_POST["current"], $_POST["new"]); break; case 'new-user': $user->new($_POST["username"], $_POST["passwd"]); break; default: // code... break; } ?>