묻고답하기

안녕하세요..  웹하드랑 어울동 비슷한 소스를 가져와서 이것저것 수정을 하고 있는데요.
프로그램쪽으로는 잼뱅이라 정말 중요한 기능을 수정하지 못하고 있어서요 꼭좀 부탁드릴게요

폴더 통채로 삭제하기/ 파일 여러개 삭제하기  이 2가지 기능을 첨부하고 싶습니다.
프로그램에 일각연이 있으신 선배님들 부탁드립니다. 아래 소스 뿌려놓겠습니다. 파일이 하나거든요 ..  그럼..

소스 쫘악 복사하셔서 파일하나 만드신다음에 서버 아무대나 올리시면 됩니다.
그리고 익스플로워로 실행시키시면 나옵니다... 프로그램에 일각연이 있으신분 부탁좀 드릴게요

죄송합니다. 한번에 올라가지가 않아서요.. 2개로 올렸습니다. 파일 하나로 만드신 다음에 익스플로워에서 실행시키면 됩니다.

<?php

/*  Copyright 1999 by John Martin d/b/a www.ANYPORTAL.com       */
/*  All Rights Reserved.                                        */
/*                                                              */
/*  This software is freeware and is not in the public domain.  */
/*  You are hereby granted the right to freely distribute this  */
/*  software as long as this copyright notice remains in place. */
/*                                                              */
/*  Comments or suggestions?   email: andmore@alief.com         */
/*                                                              */
/*  This is the PHP port: AnyPortal(php)-0.1                    */
/*  ========================================                    */
/*                                                              */
/*  PHP version 2000 by Stefan@Wiesendanger.org                 */
/*  No Rights Reserved. What for, anyhow ?                      */
/*                                                              */
/*  Date       Remarks                                          */
/*  ---------  -----------------------------------------------  */
/*  25 MAY 99  original ASP version                             */    
/*  17 SEP 99  change upload from SA-FILEUP to aspSmartUpload   */
/*  10 APR 00  simplified PHP3 version                          */
/*  18 APR 00  most of PHP3 port working. Slight modifications  */
/*  22 APR 00  modified syntax highlighting, no absolute paths  */
/*             revealed, PHP builtin authentication, global     */
/*             style sheet as callback, use apache default      */
/*             icons as an alternative to the wingdings font.   */
/*  25 APR 00  catch some exceptions (not foolproof yet)        */
/*  26 APR 00  catch some more exceptions, implicit copy        */
/*             function by saving somewhere else in the detail  */
/*             view, MD5 hashed password.                       */
/*  27 APR 00  Fixed authentication bug                         */
/*  12 MAY 00  Fixed trouble with exec() with newer versions of */
/*             PHP3. Fixed bug which would send you to a non-   */
/*             existent address after file modifications.       */

//////////////////////////////////////////////////////////////////

// TODO : Don't let the file be modified itself. Create a hash of
// it (kinda hard since it's self-referential ;-). Make better use
// of session management. Escapeshellcmd for all user input.

//////////////////////////////////////////////////////////////////

// GLOBAL PARAMETERS
// =================
// Make modifications here to suit siteman to your needs

//         error_reporting(4) ;                // how verbose ?

        // username/password should not be system
        // usernames/passwords !!

        // your (hashed) username/password here
        $gblPw    = "hash_of_your_username_and_password" ;                
        
        $gblAuth  = false ;             // use builtin authentication
        $gblHash  = "md5" ;             // hash function to use

        // choose GifIcon below unless you have the M$
        // WingDings font installed on your system

        $gblIcon = "GifIcon" ;                // MockIcon or GifIcon

        // the directory below should be /icons/ or /icons/small/
        // on Apache; a set of icons is included in the distribution

        $gblIconLocation = "icons/" ;

        // files you want to be able to edit in text mode
        // and view with (primitive) syntax highlighting

        $gblEditable = array( ".txt",".asa",".asp",".htm",".html",
                              ".cfm",".php3",".php",".phtml",
                              ".shtml",".css" ) ;

        // files that will display as images on the detail page
        // (useless if your browser doesn't support them)

        $gblImages   = array( ".jpg",".jpeg",".gif",".png",".ico",
                              ".bmp",".xbm") ;

//////////////////////////////////////////////////////////////////

function StartHTML($title,$text="") {

        $title = "Site Manager " . $title ;
        $host  = $GLOBALS["HTTP_HOST"] ;
        $self  = $GLOBALS["PHP_SELF"] ;
?>

<HTML>
<HEAD>
<TITLE><?php echo $host . " " . $title ?></TITLE>
<META NAME="description" CONTENT="PHP port of AnyPortal Site Manager">
<META NAME="keywords" CONTENT="site manager, web site maintenance">
<META NAME="robots" CONTENT="noindex">
<META HTTP-EQUIV="expires" CONTENT="0">
<LINK REL="stylesheet" TYPE="text/css"
        HREF="<?php echo $self ?>?STYLE=get">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H3 ALIGN="RIGHT"><?php echo $host ?></H3>
<!--
<TABLE BORDER=0 WIDTH="100%"><TR>
<TD CLASS=INV><?//php echo $title ?></TD></TR></TABLE>
<P><?//php echo $text ?></P>-->

<?php
} // end function StartHTML

//////////////////////////////////////////////////////////////////

function EndHTML() {
?>

<HR>
<P CLASS=FTR>
<?php echo date("D, F d, Y") ?> -<?php echo date("g:i:sA") ?>  
</P>
<BR><BR><BR></BODY></HTML>

<?php
} // end function EndHTML

//////////////////////////////////////////////////////////////////

function CSS() {
?>

BODY,TD,P,H1,H2,H3 { font-family:Helvetica,Arial,sans-serif; }
.BLK { color:black; }
.RED { color:red; }
.TOP { color:red; font-size:70%; } /* table headings */
.INV { color:white; background-color:navy;
        font-weight:bold; font-size:120%; } /* title */
.FTR { } /* footer */
.LST { background-color:#E0E0E0; } /* table cells */
.BAR { background-color:#E0E0E0; } /* action bar */
PRE { color:blue; font-family:Lucida Console,Courier New,
        Courier,sans-serif; } /* source code */
EM { color:green; font-style:normal; } /* line numbers */
.REM { color:silver; }
.XML { color:navy; background-color:yellow; }
.MCK { color:red; font-family:WingDings; } /* Mock Icons */
A:HOVER { color:red; }

<?php
} // end function CSS

//////////////////////////////////////////////////////////////////

function DetailPage($fsRoot,$relDir,$fn) {
        
        global $gblEditable, $gblImages ;
        $self = $GLOBALS["PHP_SELF"] ;

        $relPath  = $relDir . "/" . $fn ;
        $fsPath   = $fsRoot . $relPath ;
        $fsDir    = $fsRoot . $relDir ;

        $exists   = file_exists($fsPath) ;
        $ext      = strtolower(strrchr($relPath,".")) ;
        $editable = ( $ext=="" || strstr(join(" ",$gblEditable),$ext)) ;
        $writable = Writeable($fsPath) ;

        if (!$editable && !$exists)
                Error("Creation unsupported for type",$relPath) ;
        if (!exists && !Writeable($fsDir) )
                Error("Creation denied",$relDir) ;

        $text  = "Use this page to view, modify or " ;
        $text .= "delete a single document on this " ;
        $text .= "web site." ;        
        $title = "(Detail Page)" ;
        StartHTML($title, $text) ;

        echo "<H3>삭제할 파일명 : " . $relDir . "/" . $fn . "</H3>" ;
        if ($exists) {  // get file info
          $fsize = filesize($fsPath) ;
          $fmodified = date("d/M/y G:i:s", filemtime($fsPath)) ;
          $faccessed = date("d/M/y G:i:s", fileatime($fsPath)) ;
          echo "<PRE>파일 크기 : " . $fsize . " Bytes<BR>" ;
          echo "마지막 수정 날짜 : <B>" . $fmodified . "</B><BR>" ;
          echo "마지막 확인 날짜 : <B>" . $faccessed . "</B><BR>" ;
//          echo "        owner: <B>" . fileowner($fsPath) . "</B><BR>" ;
//          echo "        group: <B>" . filegroup($fsPath) . "</B><BR>" ;
//                  echo "  permissions: <B>" ;
//          echo printf( "%o", fileperms($fsPath) ) . "</B>" ;
          echo "</PRE>" ;
        }

        if ( $editable && ($writable || !$exists) ) {
                $fh = fopen($fsPath,"a+") ;
                rewind($fh) ;
                $fstr = fread($fh,filesize($fsPath)) ;
                fclose($fh) ;
                $fstr = htmlentities( $fstr ) ;
?>

<FORM ACTION="<?php echo $self ; ?>" METHOD="POST">
<SPAN TITLE="Click [SAVE] to store updated contents.">
        <B>DOCUMENT CONTENTS</B>
</SPAN><BR>
<TEXTAREA NAME="FILEDATA" ROWS=18 COLS=70 WRAP="OFF"><?php
echo($fstr) ; ?></TEXTAREA>
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?php echo $relDir ; ?>">
<INPUT TYPE="HIDDEN" NAME="FN" VALUE="<?php echo $fn ; ?>">
<INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="SAVE">
<INPUT TYPE="TEXT" SIZE=48 MAXLENGTH=255 NAME="RELPATH"
        VALUE="<?php echo $relPath ; ?>">
<INPUT TYPE="RESET" VALUE="RESET">
<INPUT TYPE="SUBMIT" VALUE="SAVE">
</FORM>

<?php
        }
/*        else if ( strstr( join(" ",$gblImages), $ext ) ) {  
          $info  = getimagesize($fsPath) ;
          $tstr  = "<IMG SRC="". $relPath . "" BORDER=0 " ;
          $tstr .= $info[3] . " ALT="" . $fn . " - " ;
          $tstr .= (int)(($fsize+1023)/1024) . "Kb">" ;
          echo htmlentities($tstr) . "<BR><BR>" . $tstr ;
        } */
?>

<FORM ACTION="<?php echo $self ; ?>" METHOD="POST">
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?php echo $relDir ; ?>">
<INPUT TYPE="HIDDEN" NAME="FN" VALUE="<?php echo $fn ; ?>">
<INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="취소"><BR>

<?php
        if ($exists && $writable) {
?>

<HR><SPAN TITLE="Check OK and click [DELETE] to delete.">
<B>정말로 다음 파일을 삭제 하시겠습니까? "<?php echo $fn ; ?>"? (체크후 DELETE를 눌러주세요)</B></SPAN>
<INPUT TYPE="CHECKBOX" NAME="CONFIRM">
<INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="DELETE">

<?php
        }
        echo "</FORM>" ;
        EndHTML() ;

} // end function DetailPage

//////////////////////////////////////////////////////////////////

function DisplayCode($fsRoot,$relDir,$fn) {

        $path = $fsRoot . $relDir . "/" . $fn ;

        if (!file_exists($path)) Error("File not found",$path) ;

        StartHTML("(".$relDir."/".$fn.")","");

        $tstr = join("",file($path)) ;
        $tstr = htmlentities($tstr) ;

        // Tabs
        $tstr = str_replace(chr(9),"   ",$tstr) ;  

        // ASP tags & XML/PHP tags
        $aspbeg = "<SPAN CLASS=XML><%</SPAN><SPAN CLASS=BLK>" ;
        $aspend = "</SPAN><SPAN CLASS=XML>%></SPAN>" ;
        $tstr = str_replace("<%",$aspbeg,$tstr) ;
        $tstr = str_replace("%>",$aspend,$tstr) ;         

        $xmlbeg = "<SPAN CLASS=XML><?</SPAN><SPAN CLASS=BLK>" ;
        $xmlend = "</SPAN><SPAN CLASS=XML>?></SPAN>" ;
        $tstr = str_replace("<?",$xmlbeg,$tstr) ;
        $tstr = str_replace("?>",$xmlend,$tstr) ;         

        // C style comment
        $tstr = str_replace("/*","<SPAN CLASS=REM>/*",$tstr) ;         
        $tstr = str_replace("*/","*/</SPAN>",$tstr) ;                         

        // HTML comments
        $tstr = str_replace("<!--","<I CLASS=RED><!--",$tstr) ;  
        $tstr = str_replace("-->","--></I>",$tstr) ;  

        echo "<PRE>" ;        

        $tstr = split("n",$tstr) ;
        for ($i = 0 ; $i < sizeof($tstr) ; ++$i) {
                // add line numbers
                echo "<BR><EM>" ;
                echo substr(("000" . ($i+1)), -4) . ":</EM> " ;
                $line = $tstr[$i] ;
                // C++ style comments
                $pos = strpos($line,"//") ;
                // exceptions: two slashes aren't a script comment
                if (strstr($line,"//") &&
                    ! ($pos>0 && substr($line,$pos-1,1)==":") &&
                    ! (substr($line,$pos,8) == "//-->") &&
                    ! (substr($line,$pos,9) == "// -->")) {
                 $beg = substr($line,0,strpos($line,"//")) ;
                 $end = strstr($line,"//") ;
                 $line = $beg."<SPAN CLASS=REM>".$end."</SPAN>";
                }
                // shell & asp style comments
                $first = substr(ltrim($line),0,1) ;
                if ($first == "#" || $first == "'") {
                 $line = "<SPAN CLASS=REM>".$line."</SPAN>";
                }
                print($line) ;
        } // next i

        echo "</PRE>" ;
                
        EndHTML() ;

} // end function DisplayCode

//////////////////////////////////////////////////////////////////

function MockIcon($txt) {
        $tstr = "<SPAN CLASS=MCK>" ;

        switch (strtolower($txt)) {
        case ".bmp" :
        case ".gif" :
        case ".jpg" :
        case ".jpeg":
        case ".tif" :
        case ".tiff":
                $d = 176 ;
                break ;
        case ".doc" :
                $d = 50 ;
                break ;
        case ".exe" :
        case ".bat" :
                $d = 255 ;
                break ;
        case ".bas" :
        case ".c"   :
        case ".cc"  :
        case ".src" :
                $d = 255 ;
                break ;
        case "file" :
                $d = 51 ;
                break ;
        case "fldr" :
                $d = 48 ;
                break ;
        case ".htm" :
        case ".html":
        case ".asa" :
        case ".asp" :
        case ".cfm" :
        case ".php3":
        case ".php" :
        case ".phtml" :
        case ".shtml" :
                $d = 182 ;
                break ;
        case ".pdf" :
                $d = 38 ;
                break;
        case ".txt" :
        case ".ini" :
                $d = 52 ;
                break ;
        case ".xls" :
                $d = 252 ;
                break ;
        case ".zip" :
        case ".arc" :
        case ".sit" :
        case ".tar" :
        case ".gz"  :
        case ".tgz" :
        case ".Z"   :
                $d = 59 ;
                break ;
        case "view" :
                $d = 52 ;
                break ;
        case "up" :
                $d = 199 ;
                break ;
        case "blank" :
                return "  </SPAN>" ;
                break ;
        default :
                $d = 51 ;
        }

        return $tstr . chr($d) . "</SPAN>" ;
} // end function MockIcon

//////////////////////////////////////////////////////////////////

function GifIcon($txt) {
        global $gblIconLocation ;

        switch (strtolower($txt)) {
        case ".bmp" :
        case ".gif" :
        case ".jpg" :
        case ".jpeg":
        case ".tif" :
        case ".tiff":
                $d = "image2.gif" ;
                break ;
        case ".doc" :
                $d = "layout.gif" ;
                break ;
        case ".exe" :
        case ".bat" :
                $d = "screw2.gif" ;
                break ;
        case ".bas" :
        case ".c"   :
        case ".cc"  :
        case ".src" :
                $d = "c.gif" ;
                break ;
        case "file" :
                $d = "generic.gif" ;
                break ;
        case "fldr" :
                $d = "dir.gif" ;
                break ;
        case ".phps" :
                $d = "phps.gif" ;
                break ;
        case ".php3" :
                $d = "php3.gif" ;
                break ;
        case ".htm" :
        case ".html":
        case ".asa" :
        case ".asp" :
        case ".cfm" :
        case ".php3":
        case ".php" :
        case ".phtml" :
        case ".shtml" :
                $d = "world1.gif" ;
                break ;
        case ".pdf" :
                $d = "pdf.gif" ;
                break;
        case ".txt" :
        case ".ini" :
                $d = "text.gif" ;
                break ;
        case ".xls" :
                $d = "box2.gif" ;
                break ;
        case ".zip" :
        case ".arc" :
        case ".sit" :
        case ".tar" :
        case ".gz"  :
        case ".tgz" :
        case ".Z"   :
                $d = "compressed.gif" ;
                break ;
        case "view" :
                $d = "index.gif" ;
                break ;
        case "up" :
                $d = "back.gif" ;
                break ;
        case "blank" :
                $d = "blank.gif" ;
                break ;
        default :
                $d = "generic.gif" ;
        }

        return "<IMG SRC="$gblIconLocation" . $d . "" BORDER=0>" ;
} // end function GifIcon
글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
우사기짱 설치문의드립니다 [2] 2015.05.22 by 불금
karutian xe 에서 Jquery 어떻게 사용하세요? [3] 2015.05.22 by LiXCode
오늘은삽질왕 이 사이트가 XE로 만들어졌는지 확인좀 해주세요. [3] 2015.05.22 by LiXCode
불금 XE 본문에서 작성자 글 모아서 보여주기 소스에서... [1] 2015.05.22 by 불금
jango848 광고 설정시 403 forbidden 에러가 뜹니다ㅠㅠ  
우사기짱 해결방법좀알려주세여 file  
아찌리 프레임으로 나눈 2개의 글을 메뉴 링크로 볼 수 있는지요? [2] file 2015.05.23 by 아찌리
해운대살고싶다 게시글의 스크랩하기를 버튼으로 따로넣으려면?? file  
똘레랑스0145a 홈페이지 배경색을 넣는 방법 좀 알려주세요. [3] 2015.05.23 by DoorWeb
okcashbag042 관리자 ip관련 [1] file 2015.05.23 by 불금
죽방망이 게시판 등록일 지우는거 어떻게 하나요? file  
choms0521 물품 거래 사이트 제작 [1] file 2015.05.23 by YJSoft
okcashbag042 xe 하단 변경 문의 [1] file 2015.05.23 by YJSoft
karutian onpresskey 에 두 가지 함 수 쓸 수 있나요?  
JerryGoldman 글을 작성하면 게시판 전체가 백지가 되는 현상 [3] file 2015.05.23 by JerryGoldman
sundriespds 첨부파일을 링크로 [4] 2015.05.23 by sundriespds
국선해선 성인인증 기능 어떻게 추가하나요? [1] 2015.05.23 by 불금
김동하123 위젯에서 배너 랜덤하게 출력시키는 법  
단기종합 동시접속자가 몰렸을때 사이트 접속이 안되는건 [1] 2015.05.23 by mAKEkr
JackPARK 초보사용자입니다. Webserver 선택  
국선해선 게시판을 갤러리 형식으로 만들고 싶은데 어떡하면 되나요? [3] 2015.05.23 by flowerrain
티처킴 쌩초보의 허접한 질문... 외부페이지 연결 file  
karutian 선택된 배경화면이 없을 때 default 출력  
이주연743 웹사이트 빌더 WEBSITE BUILDER 레이아웃 로고  
보고 스크롤 탑 에드온 공유해주실분 있으신가요?  
Alex api 로 외부페이지에서 글쓰기  
네이티브 파일 업로드 설정이 오류가 납니다 ㅠㅠ file  
불금 카페 24에서 인증메일을 Gmail로 발송시에 [16] file 2015.05.23 by GG
YBb4b49 XE 첫화면 최신글 위젯이 궁금합니다 [2] file 2015.05.23 by flowerrain
desertfox APMSETUP으로 xe 설치하려하니 오류가 뜹니다 [2] 2015.05.23 by desertfox