소스 파일 : /language/language_update.php (2020-07-31)     소스 설명 : (구현항목) 프로그램 언어별 키워드 업데이트
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
052
053
054
055
056
057
058
059
060
061
062
063
064
<?php // (2020.7.29, 차재복, Cha Jae Bok, http://www.ktword.co.kr)

# 세션 설정
	// 세션 스타트 (매 웹페이지 마다 필요)
	session_start();

	// 세션 변수에 따른 사용자 타입 설정 ('일반사용자' or '테스트편집자' or '정식편집자' or '종합관리자')
	$_SESSION['user_type'] = ( empty($_SESSION['user_name']) ? '일반사용자' : $_SESSION['user_name'] );

# 편집 권한 확인
	if ($_SESSION['user_type']!='종합관리자')	exit ('편집 권한 없음!!!');
	// ('일반사용자' or '테스트편집자' or '정식편집자' or '종합관리자')

# db 접속
	include "../base_utils/db_conn.php";

# 공통 함수 인클루드
	include "./language_utils.php";

# 대상 언어 제한
	$lang_arr = ['JS','PHP'];

# 전달변수 : act, lang, find, p

	// 동작 종류
	$act = $_REQUEST[act];

	// 언어별 파라미터 전달
	$cur_lang = $_REQUEST[lang];
	if (!in_array($cur_lang,$lang_arr)) exit ("{$cur_lang} : 확인된 언어 아님!!!"); 	// 해킹 방어

	// 키워드명 또는 번호
	$find = $_REQUEST[find];

	// 페이지 파라미터 전달
	$cur_page = $_GET['p'];	// 요청 페이지 번호
		if ( !empty($cur_page) and !is_numeric($cur_page) ) exit ("{$cur_page} : 페이지 번호 아님");	// 해킹 방어

	// 용어해설 번호
	$word_no = $_REQUEST[word_no];

# 업데이트 함수 호출
	if ( $act=='word_no_add' and !empty($find) and isset($_REQUEST[lang]) ) {
		$result_array = word_no_add ($word_no, $find, $cur_lang, $dbi);

	    // http 헤더 (json 포멧)
		header('content-type: application/json; charset=utf-8');

		// 메세지들을 json 포멧화시켜 결과 송출
	    echo json_encode($result_array,JSON_UNESCAPED_UNICODE);
	}

	// 언어별 keyword 추가
	if ( $act == 'keyword_add' and !empty($find) and isset($_REQUEST[lang]) ) {
		$result_array = keyword_add ($find, $cur_lang, $dbi);

		// http 헤더 (json 포멧)
		header('content-type: application/json; charset=utf-8');

		// 메세지들을 json 포멧화시켜 결과 송출
	    echo json_encode($result_array,JSON_UNESCAPED_UNICODE);
	}

?>


Copyrightⓒ written by 차재복 (Cha Jae Bok)
"본 웹사이트 내 모든 저작물은 원출처를 밝히는 한 자유롭게 사용(상업화포함) 가능합니다"