YesYo.com MintState Forums
뒤로    YesYo.com MintState BBS > Tech > PHP
검색
멤버이름    오토
비밀번호 
 

웹디렉토리 소스

페이지 정보

작성자 MintState 댓글 0건 조회 9,789회 작성일 08-10-29 17:16

본문

웹디렉토리 소스
 
<!--
┌───────────────────────────────────────┐ 
│                       e 넓은 세상 자료실 Version 1.0                                                   │ 
│                                                                                                                    │ 
│                                                                                  Developer . Aki_Rose    │ 
│                                                                                                                    │ 
│ 1. 이 프로그램의 소스를 무단 복제 및 재배포를 금합니다.                                     │ 
│ 2. 이 프로그램을 사용함으로 생기는 피해에 대하여 제작자는 책임을 지지 않습니      │ 
│   다.                                                                                                            │ 
│                          문제점 발견시 akirose@howdns.com으로 연락주십시오.              │ 
└───────────────────────────────────────┘ 
--> 

<html> 

<head> 
<meta http-equiv="content-type" content="text/html; charset=euc-kr"> 
<title>자료실</title> 
<style type="text/css"> 
.wj { color:#000000; font-size:9pt; line-height:130% } 

p. { font-size:9pt; font-family:굴림; line-height:140%; } 

.bolder { border:1px solid black; } 

A:LINK, A:VISITED { 
        color : Black; 
        text-decoration : none; 
} 
A:HOVER { 
        text-decoration : underline; 
} 

body { 
background:;overflow-y : scroll; 
scrollbar-face-color:#f9f9f9; 
scrollbar-shadow-color:#cccccc; 
scrollbar-highlight-color: white; 
scrollbar-3dlight-color: white; 
scrollbar-darkshadow-color: white; 
scrollbar-track-color: white; 
scrollbar-arrow-color: #cccccc;} 
</style> 
</head> 

<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red" leftmargin="3" marginwidth="3" topmargin="8" marginheight="8"> 
<table cellpadding="0" cellspacing="0" width="312"> 
    <tr> 
        <td width="988"> 
            <table align="center" cellpadding="0" cellspacing="0" width="300"> 
                <tr> 
                    <td width="302"> 
                        <table cellpadding="0" cellspacing="0" width="300" style="border:1px solid black;"> 
                            <tr> 
                                                                <td width="300" height="2" colspan="2"> 
                                                                <p></p> 
                                                                </td> 
                                                        </tr> 
                                                        <tr> 
                                <td width="20"> 
                                    <p align="center"><img src="images/pds_icon.jpg" width="12" height="11" border="0" align="top"></p> 
                                </td> 
                                <td width="280"> 
                                    <p class="wj">e넓은세상 자료폴더</p> 
                                </td> 
                            </tr> 
                        </table> 
                    </td> 
                </tr> 
                <tr> 
                    <td width="302" height="5"> 
                        <p></p> 
                    </td> 
                </tr> 
<? 
$check=explode("/",$p); 
$cs=sizeof($check); 

if(!$p || substr($p,0,1)=="/" || $p=="./files/../" || $p=="files/../" || $check[1]!="files" || $check[$cs-3]."/".$check[$cs-2]=="../..") $p="./files/";  //Path Filtering 

if(substr($p,-3)=="../"){ //URL Cut 
        $p=explode("/",$p); 
        $size=sizeof($p); 
        unset($p[$size-2]); 
        unset($p[$size-3]); 
        $p=implode ("/", $p); 
}                                                 //End of URL Cut 

if($p=="./files" || $p=="files/" || $p=="./files/" || $p=="files") $root=1; 

@$opendir = dir($p); // 디렉토리 헨들을 연다. 
$i = 0; 
while(@$dir=$opendir->read()) { // 디렉토리 안의 파일 및 폴더를 읽어옴 
    if (is_dir($p.$dir) && $dir!="." ) { // 읽어온 자료중 디렉토리만 골라냄 
        $dirs[$i]=$dir; // 골라낸 디렉토리를 배열로 만듬 
        $i++; 
        } 
} 
        ?> 
<? 
        @sort ($dirs); //디렉토리 배열을 정렬함 
        while (list ($key, $value) = @each($dirs)) { 
            $dirs[$key] = $value; 
        } 

        $dirarray=sizeof($dirs); 

        for($i=0; $i<$dirarray; $i++){ 
?> 

                                <? if($root!=1){ ?> 

                                <tr> 
                                        <td> 
                                        <table border="0" cellspacing="0" cellpadding="0" width="300" height="16"> 
                                        <tr onmouseover=this.style.backgroundColor='#EEEEEE' onmouseout=this.style.backgroundColor=''> 
                                                <td width="16" height="16" background="images/dir_icon.jpg"> 
                                                </td> 
                                                <td width="234"> 
                                <p style="font-size:9pt;"> <a href="pds.php?p=<? echo $p.$dirs[$i]."/"; ?>"><? echo "$dirs[$i]"; ?></a></p> 
                            </td> 
                                                <td width="50"> 
                                                        <p style="font=size:9pt; color:gray;" align="right"> </p> 
                                                </td> 
                                        </tr> 
                                        <tr> 
                                                <td width="300" height="3" colspan="3"><p></p></td> 
                                        </tr> 
                                        </table> 
                                        </td> 
                </tr> 

                                <? } 
                                $root=0; 
                                ?> 

<? 
} 
$opendir->close(); 
?> 

<? 
@$opendir = dir($p); // 디렉토리 헨들을 연다. 
$i = 0; 
while(@$file=$opendir->read()) { // 디렉토리 안의 파일 및 폴더를 읽어옴 
    if (is_file($p.$file)) { // 읽어온 자료중 파일만 골라냄 
        $files[$i]=$file; // 골라낸 파일을 배열로 만듬 
        $i++; 
        } 
} 
        ?> 
<? 
        @sort ($files); // 파일 배열을 정렬함 
        while (list ($key, $value) = @each($files)) { 
            $files[$key] = $value; 
        } 

        $filearray=sizeof($files); 
        for($i=0; $i<$filearray; $i++){ 

        $check=explode(".",$files[$i]); 
        $sizeof=sizeof($check); 
        $check[$sizeof-1]=strtolower($check[$sizeof-1]); 
        if($check[$sizeof-1]=="txt" || $check[$sizeof-1]=="doc" || $check[$sizeof-1]=="hwp"){ $icon="doc_icon.jpg"; } 
        elseif($check[$sizeof-1]=="asf" || $check[$sizeof-1]=="wav" || $check[$sizeof-1]=="mp3" || $check[$sizeof-1]=="mp2" || $check[$sizeof-1]=="mpg" || $check[$sizeof-1]=="wmv" || $check[$sizeof-1]=="mid"){ $icon="sound_icon.jpg"; } 
        elseif($check[$sizeof-1]=="arj" || $check[$sizeof-1]=="zip" || $check[$sizeof-1]=="tar" || $check[$sizeof-1]=="lzh" || $check[$sizeof-1]=="gz" || $check[$sizeof-1]=="z" || $check[$sizeof-1]=="rar"){ $icon="arc_icon.jpg"; } 
        elseif($check[$sizeof-1]=="jpg" || $check[$sizeof-1]=="gif" || $check[$sizeof-1]=="bmp" || $check[$sizeof-1]=="png" || $check[$sizeof-1]=="psd"){ $icon="pic_icon.jpg"; } 
        elseif($check[$sizeof-1]=="exe" || $check[$sizeof-1]=="com" || $check[$sizeof-1]=="bat"){ $icon="exe_icon.jpg"; } 
        elseif($check[$sizeof-1]=="htm" || $check[$sizeof-1]=="html"){ $icon="htm_icon.jpg"; } 
        else { $icon="ect_icon.jpg"; } 
?> 

                        <tr> 
                                        <td> 
                                        <table border="0" cellspacing="0" cellpadding="0" width="300" height="16"> 
                                        <tr onmouseover=this.style.backgroundColor='#EEEEEE' onmouseout=this.style.backgroundColor=''> 
                                                <td width="16" height="16" background="<? echo "images/".$icon; ?>"> 
                                                </td> 
                                                <td width="234"> 
                                <p style="font-size:9pt;"> <a href="<? echo $p.$files[$i]; ?>" target="_blank"><? echo "$files[$i]"; ?></a></p> 
                            </td> 
                                                <td width="50"> 
                                                        <p style="font=size:9pt; color:gray;" align="right"><? $size=filesize($p.$files[$i]); $size=intval($size/1024); echo $size."KB"; ?></p> 
                                                </td> 
                                        </tr> 
                                        <tr> 
                                                <td width="300" height="3" colspan="3"><p></p></td> 
                                        </tr> 
                                        </table> 
                                        </td> 
                </tr> 
<? 
$totalsize=$totalsize+$size; 
} 
$opendir->close(); 
?> 
                                <tr> 
                                        <td width="300" style="border-top:1px solid black;"> 
                                        <table cellspacing="0" cellpadding="0" border="0" width="300"> 
                                        <tr> 
                                                <td width="150"> 
                                                        <p class="wj">총 파일 갯수 : <? echo $i; ?>개</p> 
                                                </td> 
                                                <td width="150"> 
                                                        <p class="wj" align="right">전체파일크기 : <? if(!$totalsize) $totalsize=0; echo $totalsize; ?>KB</p> 
                                                </td> 
                                        </tr> 
                                        </td> 
                                </tr> 
            </table> 
        </td> 
    </tr> 
</table> 
</body> 

</html>

댓글목록

등록된 댓글이 없습니다.

Total 165건 6 페이지
PHP 목록
번호 제목 글쓴이 조회 날짜
40 MintState 12541 10-31
39 MintState 13297 10-31
38 MintState 11505 10-31
37 MintState 12992 10-31
36 MintState 13709 10-31
35 MintState 11523 10-31
34 MintState 11132 10-31
33 MintState 17924 10-31
32 MintState 14562 10-31
31 MintState 11787 10-31
30 MintState 13593 10-29
29 MintState 17907 10-29
28 MintState 12279 10-29
27 MintState 10481 10-29
26 MintState 16406 10-29
25 MintState 13404 10-29
24 MintState 14844 10-29
23 MintState 14792 10-29
22 MintState 14885 10-29
21 MintState 12252 10-29
20 MintState 11072 10-29
19 MintState 11528 10-29
18 MintState 12514 10-29
17 MintState 10570 10-29
열람중 MintState 9790 10-29
게시물 검색
모바일 버전으로 보기
CopyRight ©2004 - 2024, YesYo.com MintState. ™