묻고답하기

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

폴더 통채로 삭제하기/ 파일 여러개 삭제하기  이 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 남기남
Editor98 윅스 메인 페이지에 콘텐츠 위젯으로 최근 게시물 표시 중... [5] file 2015.05.26 by YJSoft
똘레랑스0145a XE Core ver. 1.8.2 업그레이드 후 관리자 오류 [1] 2015.06.28 by 똘레랑스0145a
XE모듈 이 모바일 게시판은 어떤건가요? [2] file 2015.06.28 by 숭숭군
경주고을아낙네 오류메시지-'테이블 xe_documents'는 읽기 전용입니다 [2] 2015.06.28 by 오픈CMS
KEEPER00 파일박스 오류 [3] file 2015.05.26 by newi
cycix2 업데이트 또는 이전시 게시글 이전 질문입니다. [6] file 2015.05.26 by cycix2
쮸야282 1.4. 입니다. 절대경로 어디서 확인 할까요? 제발좀 부탁드립니다....ㅠㅠ [1] 2015.05.26 by 쮸야282
네이츠 xedition 레이아웃 에 이미지 질문이요 file  
safe장 관리자 로그인 에러 (fatal error)  
쫑효다컴 sketchbook5_youtube 스킨-썸네일오류질문입니다.  
코드귀신 [XE초보자] 레이아웃, 애드온, 위젯 설치 방법에 관하여.. [1] 2015.05.26 by 바이미스타벅스커피
꾸링 이전에 있던 페이지에서 접속할경우 [1] 2015.05.26 by 바이미스타벅스커피
hjkguy767 서버에 mod_cband 설치 후 트래픽 초과 페이지.. [4] 2015.05.26 by hjkguy767
likexe 자른 이미지를 표를 만들어 넣었는데.. 간격이 떨어집니다. [2] file 2015.05.26 by likexe
똘레랑스0145a XE Core ver. 1.8.2 업그레이드 오류 [2] 2015.05.26 by 똘레랑스0145a
큰돌♡ 모듈 설정 페이지를 모바일 뷰로 보이게 하려면 어떻게 해야 할까요?  
태봉23 레벨아이콘 적용안됨 [2] 2015.05.25 by 불금
착한동구 인증메일이 안갑니다 [4] 2015.05.25 by 착한동구
socialskyo GIF 애니메이션 섬네일은 지원 안되죠? [3] 2015.05.25 by 몽실아빠
xfweb 섬네일이 안 보입니다.. [9] file 2015.05.25 by xfweb
desertfox XE에서의 회원가입과 관련하여 질문있습니다  
똘레랑스0145a 홈페이지 레이아웃 오류 [2] 2015.05.25 by 똘레랑스0145a
knhpc xedition레이아웃에서 게시판 상당 이미지에 글자 크기 [2] file 2015.05.25 by knhpc
TakeUrban 게시판 글 등록후 본문으로 넘어가지 않는 현상  
착한동구 왕초보예요 도와주세요 [4] file 2015.05.25 by 착한동구
color77 xe는 버전업하는게 두렵습니다 ㅜㅜ 혹시 xe 1.5 버전이 해킹 당할수있나요? xe 1.5 버전으로 쓰면 안될까요? [5] 2015.05.25 by color77
color77 1.7 최종버전으로 업하다가 충돌나서 백지화 됬는데요 이거 어떤 위젯 애드온이 때문에 백지화되는지 쉽게 아는법 없나요? [2] 2015.05.25 by color77
pianoguy XE 애드온 자동 업데이트후 사이트 접속이 안됩니다. [5] 2015.05.25 by DoorWeb
존횬 모바일 게시판에서 제목 크기 어떻게 수정하나요? [1] 2015.05.25 by DoorWeb
으핫핫동자 안드로이드에서 첨부파일 내려받기 에러..