source: branches/feature-module-update/html/test/uehara/file_view.php @ 15532

Revision 15532, 688 bytes checked in by nanasess, 17 years ago (diff)

svn:mime-type 修正

  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
1<?php
2/*
3 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7
8require_once("../../require.php");
9
10// ソースとして表示するファイルを定義(直接実行しないファイル)
11$arrViewFile = array(
12                     'html',
13                     'htm',
14                     'tpl',
15                     'php',
16                     'css',
17                     'js',
18);
19
20// 拡張子取得
21$arrResult = split('\.', $_GET['file']);
22$ext = $arrResult[count($arrResult)-1];
23
24// ファイル内容表示
25if(in_array($ext, $arrViewFile)) {
26    // ファイルを読み込んで表示
27    header("Content-type: text/plain\n\n");
28    print(sfReadFile(USER_PATH.$_GET['file']));
29} else {
30    header("Location: ".USER_URL.$_GET['file']);
31}
32?>
Note: See TracBrowser for help on using the repository browser.