소스 파일 : /reform/notice.php (2019-01-26)     소스 설명 : (개선중) 텍스트 파일을 웹페이지로 보기
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
065
066
067
068
069
070
071
072
073
074
075
076
077
078
079
080
081
082
083
084
085
086
087
088
089
090
091
092
093
094
095
096
097
098
099
<?php // (2019.1.26, 차재복, Cha Jae Bok, http://www.ktword.co.kr) 

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

# test home directory
	$test_home = '..';

# html 선언
echo "<!DOCTYPE html>";
echo "<html>";

# html 헤더부 선언
echo "<head>";

	// utf-8 셋팅
	echo "<meta http-equiv='content-type' content='text/html; charset=utf-8'>";  // 
	echo "<title>정보통신기술용어해설(개선중)</title>";

	// mobile 체킹 및 적응
	require_once '../../mobiledetect/Mobile_Detect.php';
	$detect = new Mobile_Detect;
	if ( $detect->isMobile() and !($detect->isTablet()) ) { // 순수 모바일 기기 (not tablet)
		echo "<meta name='viewport' content='user-scalable=yes, width=device-width, initial-scale=1.0' />";
	}

	// styling
	echo "<style type='text/css'>
				body { line-height: 200%; font-size: 13px; }
				pre { margin-bottom:20px; }
			</style>";

echo "</head>";

# html 본문부 선언
echo "<body>";

# 전달 파라미터 처리
	// htmlspecialchars 여부
	$ishtml = ( $_GET['html']==1 ? true : false );



	// (디렉토리명) 처리
	$dir = substr($_GET['dir'],0,9);
	$dir_arr = array('coding');
	$dir_match = false;
	foreach ( $dir_arr as $value ) {
		if (empty($dir)) {
			$dirname = './';
			$dir_match = true;
			break;
		} else if ( $dir == $value) {
			$dirname = '../'.$value.'/';
			$dir_match = true;
			break;
		}
	}

	// (파일명) 처리
	$filename_pre = substr($_GET['file'],0,10);
	$filename_arr = array('op_env.2nd','op_idea.txt','coding.2nd','code_rule.txt','op_files.2nd','direction.txt','reference.txt','string.txt');
	$file_match = false;
	foreach ( $filename_arr as $value ) {
		if ( substr($value,0,strrpos($value,'.')) == $filename_pre ) {
			$filename = $value;
			$file_match = true;
			break;
		}
	}

	if ( $dir_match == false or $file_match == false ) {
		exit ("대상 경로 파일명이 아니므로, 종료됨 ... ");
	}

# 본문 top section : 전달변수($test_home, $title)
	include "{$test_home}/reform/top_section.php";

	// 수평선
	echo "<hr>";

# 해당 파일 내용 입수
	$contents = file_get_contents($dirname.$filename);

	if ($ishtml == false) $contents = htmlspecialchars($contents);

# 입수된 파일 내용 출력
	echo "<pre>".$contents."</pre>";

# 저작권 알림
	include "../base_utils/copyright.php";

# 통계 처리
	include_once "../base_utils/db_conn.php";
	include "../base_utils/stat_utils.php";
	html_access($filename,$dbi); 

?>


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