source: branches/rel/html/test/uehara/file_view.php @ 12157

Revision 12157, 635 bytes checked in by uehara, 17 years ago (diff)
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.