001002003004005006007008009010011012013014015016017018019020021022023024025026027028029030031032033034035036037038039040041042043044045046047048049050051052053054055056057058059060061062063064065066067068069070071072073074075076077078079080081082083084085086087088089090091092093094095096097098099
<?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); ?>