include_once "./db_manager.php"; use orangelab\DBManager; /* * ERROR CODE * 101 - NO SERVICE ==> 지원하지 않는 서비스 * 103 - FAILED ==> 실패 * 777 - SUCCESS ==> 성공했다는 의미 */ // 상수 $table_instanceid = "kit_subscriber"; $table_keyword = "kit_keywords"; $table_wished_keyword = "kit_wished_keywords"; $table_members = "kit_members"; $task = $_GET['task']; $dbm = new DBManager(); if ($task == "register") { //기기등록(instance id를 등록하고 서버 상의 id를 부여받는 작업) $instance_id = urldecode($_GET['ins_id']); //$instance_id = $_GET['ins_id']; $dbm->db_insert($table_instanceid, "NULL, '" . $instance_id . "'"); // 가입완료 $value_userid = $dbm->db_query2("SELECT user_id FROM " . $table_instanceid . " WHERE device_id='" . $instance_id . "'"); $user_id = $value_userid[0]['user_id']; print json_encode(array("code" => "777", "user_id" => $user_id)); //print("777<br>"); //print($user_id); } else { if ($task == "keyword") { // 키워드 등록 작업 $keyword_name = urldecode($_GET['keyword']);
<?php include_once "./db_manager.php"; use orangelab\DBManager; $msg = urldecode($_GET["msg"]); if (!$_GET["msg"]) { echo "NULL!!"; } else { $dbm = new DBManager(); $dbm->db_insert("kit_feedback", "NULL, " . "'{$msg}'" . ", CURRENT_TIMESTAMP"); echo "SUCCESS"; }
<?php include_once "./db_manager.php"; use orangelab\DBManager; $table_login = "******"; $dbm = new DBManager(); /* * 120 - id 존재x * 121 - pw 불일치 */ $user_id = urldecode($_GET['userid']); $user_pw = urldecode($_GET['password']); //id 존재 체크. 존재한다면 그 아이디의 pw와 비교를 한다. $rvalue_table_login = $dbm->db_query2("SELECT user_id FROM " . $table_login . " WHERE user_id='" . $user_id . "'"); if ($rvalue_table_login != null) { //pw 체크 $rvalue_att_pw = $dbm->db_query2("SELECT user_id FROM " . $table_login . " WHERE user_id='" . $user_id . "' and pw='" . $user_pw . "'"); if ($rvalue_att_pw != null) { //로그인 성공 print json_encode(array("code" => "777")); } else { //pw 틀려서 로그인 실패 print json_encode(array("code" => "121")); } } else { //id 존재x print json_encode(array("code" => "120")); }