묻고답하기

<style type="text/css">
p                                                        {font-size:9pt; color:#4D4D4D; line-height:160%;}

.inputform                                {
                                                        border-width:1px; border-color:#B9B9B9; border-style:solid;
                                                        font-size:9pt; color:#737373; font-family:Verdana;
                                                }
</style>
<?
if($mode=="send"){
        $tomail = "sissy77@hanmail.net";

// 결과메시지 출력
        function result($message) {
?>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
        <td>
        <p align="center"><?=$message?><br><br><input type=button value="Back" onclick="history.back()"></p>
        </td>
</tr>
</table>
<?
        exit;
        }

        if(!$from) result("보내는 사람의 이름을 입력하세요.");
        if(!$frommail) result("보내는 사람의 메일을 입력하세요.");
        if(!$subject) result("제목을 입력하세요.");
        if(!$content) result("내용을 입력하세요.");

// 메일보내기 형식
        $mailheaders  = "Return-Path: $frommailrn";
        $mailheaders .= "From: $from <$frommail>rn";
        $mailheaders .= "Reply-To: $frommailrn";
        $mailheaders .= "MIME-Version: 1.0rn";

// 파일 첨부시
        if ($userfile_name && $userfile_size){
                $filename=basename($userfile_name);
                $result=fopen($userfile,"r");
                $file=fread($result,$userfile_size);
                fclose($result);

                if ($userfile_type == ""){
                        $userfile_type = "application/octet-stream";
                }

                $boundary = "--------" . uniqid("part");

                $mailheaders .= "Content-Type: multipart/mixed; boundary="$boundary"";

                $body  = "This is a multi-part message in MIME format.rnrn";
                $body .= "--$boundaryrn";
                $body .= "Content-Type: text/html; charset=euc-krrn";
                $body .= "Content-Transfer-Encoding: 8bitrnrn";

                if($html){
                        $body .= nl2br(stripslashes($content)) . "rnrn";
                }else{
                        $body .= nl2br(htmlspecialchars(stripslashes($content))) . "rnrn";
                }

                $body .= "--$boundaryrn";
                $body .= "Content-Type: $userfile_type; name="$filename"rn";
                $body .= "Content-Transfer-Encoding: base64rnrn";
                $body .= ereg_replace("(.{80})","\1rn",base64_encode($file));
                $body .= "rn--$boundary" . "rn";
        }        

// 파일 미첨부시
        else{
                $mailheaders .= "content-Type: text/html; charset=euc-krrn";
                if($html){
                        $body  = nl2br(stripslashes($content)) . "rnrn";
                }else{
                        $body  = nl2br(htmlspecialchars(stripslashes($content))) . "rnrn";
                }
        }

        $result=mail( $tomail , $subject , $body , $mailheaders );

// 결과 출력
        if($result){
                result("메일을 보냈습니다.");
        }else{
                result("메일 보내기에 실패했습니다.");
        }
}
?>

<form method="post" enctype="multipart/form-data" action="<?=$PHP_SELF?>?mode=send">
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
        <td width="50" height="25">
        <p align="center">이름</p>
        </td>
        <td width="5">
        </td>
        <td>
        <p><input type="text" name="from" style="width:300" class="inputform"></p>
        </td>
</tr>
<tr>
        <td height="25">
        <p align="center">메일</p>
        </td>
        <td width="5">
        </td>
        <td>
        <p><input type="text" name="frommail" style="width:300" class="inputform"></p>
        </td>
</tr>
<tr>
        <td height="25">
        <p align="center">제목</p>
        </td>
        <td width="5">
        </td>
        <td>
        <p><input type="text" name="subject" style="width:300" class="inputform"></p>
        </td>
</tr>
<tr>
        <td>
        <p align="center">내용</p>
        </td>
        <td width="5">
        </td>
        <td>
        <p><INPUT TYPE="radio" NAME="html" value="" checked> Text <INPUT TYPE="radio" NAME="html" value="html"> Html</p>
        </td>
</tr>
<tr>
        <td>
        </td>
        <td width="5">
        </td>
        <td>
        <p><textarea name="content" style="width:300; height:150;"></textarea></p>
        </td>
</tr>
<tr>
        <td height="25">
        <p align="center">첨부</p>
        </td>
        <td width="5">
        </td>
        <td>
        <p><input type="file" name="userfile" style="width:300" class="inputform"></p>
        </td>
</tr>
<tr>
        <td height="25" colspan="3">
        <p align="center"><input type="submit" value="보내기"></p>
        </td>
</tr>
</table>
</form>
글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
Hframe 아래질문과 연관....  
Hugh 마우스 오버시 해당 영역 외의 부분 어둡게 하기?  
나양 모든 index 파일에 문구삽입  
백승우 파일첨부 폼메일관련 질문 [1] 2007.08.10
이은효 top버튼 질문입니다. [1] 2007.08.10
최윤규 복사하면 자동으로 출처나오게 하는 방법 아세요??  
도길문 플래쉬 메뉴의 문제점... [2] 2007.08.10
유병만 서기님 메모장만들기에서 저장부분에서 안되네요..갑갑합니다.. [1] 2007.08.10
장용걸 한글 체크하는 방법갈켜주세요~ [1] 2007.08.10
양헌정 웹페이지 사이즈를 고정하는 방법좀 알려주세요. [1] 2007.08.10
정서은 이미지슬라이드에서 이미지 클릭시 따른 페이지로 이동하는법 [1] 2007.08.10
닉키 스크롤 따라다니는 탑버튼 소스 수정좀 도와주세요..;;  
Yoo 외부로그인, 플래시카운터 설치 후 그림엑박뜹니다.  
이은효 페이지에 레벨제한주기 질문입니다. [1] 2007.08.10
이희순 왜 화면이 뜨질 않을까요? [1] 2007.08.10
정서은 롤오버 메뉴에서 버튼이미지 깨짐 현상 [1] 2007.08.10
돌고래 드롭다운메뉴 질문입니다.  
장하늘 헤드&풋 나눌때요.. [1] 2007.08.10
장하늘 헤더만 설정했는데 문제가생겼습니다. [2] 2007.08.10
유병만 서기님 25강의에서 setcookie 이 문구만 입력하면 에러떠요. [2] 2007.08.10
●┣●┃~* 팝업창~~~질문~~~급!! [1] 2007.08.10
미노미 브라우저를 동적으로 부드럽게 리사이즈하기 응용 좀 부탁드려요.  
오유경 스타일이 적용된 상태의 웹페이지에 가로 스크롤바 없애기. [1] 2007.08.10
김태일 해상도와 상관없이 이어지는 배경 어떻게.... [2] 2007.08.10
이영오 회원관리프로그램 [2] 2007.08.10
박광렬 이미지 링크에서 공백이 없어지질 않아요...ㅠ.ㅠ [1] 2007.08.10
김수낙 홈페이지 디자인과 관련해서 궁금증이 있습니다. [2] 2007.08.10
이병진 안녕하세요,,테이블 구조 때문에 물어볼께여,,ㅜㅜ [1] 2007.08.10
배지 트래픽관련문의? [1] 2007.08.10
최진 Unknown 칼럼 ''point'' in ''field list'' 는 메시지가 뜨면서