묻고답하기

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

폴더 통채로 삭제하기/ 파일 여러개 삭제하기  이 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 남기남
kunbi 이 폰트가 궁금해요.. [2] 2007.08.10
臥龍先生 이 소스를 어떻게 쓰는지를 모르겠습니다.. [4] 2007.08.10
잇츠 노프레임에서여.. 화면에... 테두리를 어떻게?? [3] 2007.08.10
박영욱 프레임 동시에 닫으려면 어떻게 해야하나요? [1] 2007.08.10
ipstack 로그인 글자색이 열린 보드에 따라서 바뀌는 문제 [3] 2007.08.10
쌍이조폭 다운로드가 안되요. 이럴땐 어떻게해야하죠? [1] 2007.08.10
석동열 윈도우 운영체제에서 돌리는 서버는 안좋나요? [3] 2007.08.10
석동열 음.. 또 질문 ㅡㅡ 근데.. FTP 서버에서 아무리 설정을 한다구 해도..ㅡㅡ [3] 2007.08.10
처처 일본웹 해석하는 사이트 아시는분.^____________^? [2] 2007.08.10
박상영 게시판의 글을 읽은 회원과 읽은 시간을 표시하려면 어떻게 해야 하나요? [1] 2007.08.10
써니 노프레임 사이트에 iframe 태그 삽입하면 테이블이 깨져요.. [5] 2007.08.10
이주경 배경음악이 끊겨요... 이유를 모르겠네요. [1] 2007.08.10
안수향 도트에 대해 궁금한게 있어서요... [2] 2007.08.10
움하핫 아이프레임이 레이더 위쪽으로 있던데... [3] 2007.08.10
백승기 초보^^; 궁금한데여 [3] 2007.08.10
심상역 [Flash]심벌로 다른심벌 위치 조정하기 어떻게하나요>  
Siny™ 현재 창을 최소화 하는 html태그나 자바 스크립트는 없나요? [2] 2007.08.10
최신혁 홈페이지는 만들고싶은데 실력이안되서 ㅡ,.ㅡ;;; 심플한 메뉴나 그런거 만드는거 많은 홈페이지 아시면소개좀... [1] 2007.08.10
카르페디엠 object를 이용한 배경음악 랜덤으로 나오게... [1] 2007.08.10
으녕이 해상도에 따른 레이어 위치 고정 [1] 2007.08.10
이지호 리얼플레이어 파일들(*.ra, *.ram, *.rm)을 게시판에 embed 태그 처럼 쓸수 있는 방법은 없나요??? [1] 2007.08.10
오케바리 웹하드랑 비슷한 소스인데요.. 도와주세요 1/2  
오케바리 웹하드랑 비슷한건데요.. 도와주세요... 2/2 [1] 2007.08.10
이지은 휴... 아이프레임.. 질문요...--;; [1] 2007.08.10
영진 관리자님 이것 좀 가르쳐주세요. [1] 2007.08.10
영진 저 좀 도와주세요 [2] 2007.08.10
이강지 [질문] HTML 소스를 보니... [2] 2007.08.10
송봉섭 프레임1개로 잡고 표로 나눈상태에서 표에서 링크가 가능합니까? [2] 2007.08.10
박재중 노프레임 질문좀 드릴께요 [3] 2007.08.10
김형재 해상도별 스크립트에 적용에대해 nzeo.com메뉴에대한질문 [2] 2007.08.10