Files
firstgarden-web-gnu/manager/reg.update.php

28 lines
853 B
PHP

<?php
include_once './_common.php';
// 변수 선언
$user_id = trim($_POST['user_id']);
$user_pw = password_hash(trim($_POST['user_pw']), PASSWORD_DEFAULT); // 패스워드 암호화
$tid = trim($_POST['tid']);
$user_name = trim($_POST['user_name']);
$memo = trim($_POST['memo']);
$user_lv = 1;
$time = date("Y-m-d H:i:s");
// 쿼리
$query = "INSERT INTO {$fg['member_table']} (user_id, user_pw, tid, user_name, user_lv, join_datetime, used, memo) ";
$query .= "VALUES('{$user_id}', '{$user_pw}', '{$tid}', '{$user_name}', '{$user_lv}', '{$time}', 0, '{$memo}') ";
$result = sql_query($query);
// log 기록
$work = "사용자등록요청";
$work_detail = "ID : ".$user_id;
log_update($work, $work_detail, "guest", $time);
$data = array("isSuccess" => $result);
header("Content-Type: application/json");
echo json_encode($data);