묻고답하기

폼에일에서염 ....  이거 같은 경우에는 각각의 폼에 아무런 텍스트도 들어가지 않은 상태에서

메일보내기를 하면 작성 내용 중 빠트린 것이 있다는 경고가 나옵니다 ...

그런데 이것을 .......

약간 수정하여 ...  받는사람 메일 주소나 보내는 사람 메일 주소가 이메일 주소 형식에

어긋났을때에 이메일 주소를 다시 쓰라는 경고문이나 경고 페이지로 이동하게 할려면

이 소스를 어떻게 수정해야 할까요 ??

고수님들께 부탁드립니다 ...........

폼메일 주소 : http://www.yagobo.com/cgi-bin/spmail/spmail_km.cgi

================================spmail_km.cgi 소스 시작 ==================

#!/usr/bin/perl

&perse;
#------------------- 수정해야 할 부분 -----------------------------
$cgi_url="http://www.yagobo.com/cgi-bin/spmail/spmail_km.cgi";                       # spmail.cgi파일이 있는곳의 URL
$img_url="http://www.yagobo.com/cgi-bin/spmail";                                       # 이미지 URL
$mail_prog='/usr/sbin/sendmail';     # 서버에서 sendmail프로그램 절대경로
$homeframe="http://cafe.daum.net/kmcasting";   # 편지보낸후 [홈으로]를 클릭 했을때 가는 프레임!
$home_url="http://cafe.daum.net/kmcasting";                         # 보낸 메일에 표시될 자신의 홈페이지 주소
$to_mail='yagobo1@hanmail.net';                       # 받는사람 email에 기본으로 표시될 메일(안적어두 됨-.-)
$color1="#FFB524";             #메일 테이블의 진한색(이색도 이뻐요->#64AC4C)
$color2="#FFF3E9";             #메일 테이블의 연한색(이색도 이뻐요->#EFFFE8)
#---------------------------------------------------------------
# 인터피아 사용자는 homeframe과 home_url 그리고 to_mail만 수정해서 쓰시면 됩니당.*^^*

$ip = $ENV{'REMOTE_ADDR'};

if(!$FORM{'gotomail'}){
        &write_form;
}

&error;
&get_time;
&send_mail;
&ending_form;

sub perse{
        if($ENV{'REQUEST_METHOD'} eq "GET") {
                $buffer = $ENV{'QUERY_STRING'};
    }
        else {
        read( STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
    }

    @pairs = split(/&/,$buffer);
    foreach $pair( @pairs ) {
        ($name,$value)=split(/=/,$pair);
                $value =~ tr/+/ /;
                $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
                $FORM{$name} = $value;
    }
}

sub head {
                print "Content-type: text/htmlnn";
                print "<html>n";
                print "<head>n";
                print "<title>= Form Mail =</title>n";
                print "<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">n";
                print "<style type='text/css'>n";
                print "<!--n";
                print "A:link {font:9pt 굴림;color:black;text-decoration:none;}n";
                print "A:visited {font:9pt 굴림;color:black;text-decoration:none;}n";
                print "A:active {font:9pt 굴림;color:red;text-decoration:underline;}n";
                print "A:hover {color:blue;text-decoration:underline;}n";
                print ".main {color:$head_color;font-family:Verdana,Arial,굴림;font-size:10pt}n";
                print "p,br,body,td,select,input,form,textarea,option {font-size:10pt;}n";
                print ".ad{border:1 solid black}n";
                print ".cont{line-height:140%}n";
                print ".t{line-height:140%}n";
                print "-->n";
                print "</style>n";
                print "<script language="JavaScript">n";
                print "        function newin(width,height,url,name) {n";
                print "        msgWindow=window.open(url,name,'statusbar=no,scrollbars=no,status=yes,resizable=yes,width='+width+',height='+height)n";
                print "        }n";
                print "</script>n";
print <<STARTTT;
<script language=javascript>
function clearField(field){ if (field.value == field.defaultValue) {  field.value = ''; } }
function checkField(field){ if (field.value == '') { field.value = field.defaultValue; } }
</script>
STARTTT
                print "</head>n";
                print "<body><center>n";
}

sub foot {
        print "</center></body></html>n";
        exit;
}

sub error{
        if($FORM{'ment'} eq "" || $FORM{'tomail'} eq "" || $FORM{'myname'} eq "" || $FORM{'mymail'} eq "" || $FORM{'title'} eq "")
        {
                &head;
                print "<div align=left>n";
                print "<table border="0" cellspacing="0" width="500"><tr align="center"><td>n";
                print "<p> <p><br><br><br><br><br><br><br><font color=#200040>에러가 났습니다 ^.^;; 뭐 빠뜨린거 없나요?<p>모든 항목을 형식에 맞게 빼먹지 말고 적어 주세요! Please!</font><p>n";
                print "<A HREF="javascript:history.go(-1)" onfocus="this.blur()"><b><font color=#200040>◀◀ B A C K ▶▶</font></b></a>n";
             print "</td></tr></table></div>n";
                &foot;
        }
}

sub send_mail{
open (MAIL, "|$mail_prog -t") || die "화일 열기 실패!n";
           if ($FORM{'html'} ne "1") {
            $FORM{'ment'} =~ s/</</g;
        $FORM{'ment'} =~ s/>/>/g;
        $FORM{'ment'} =~ s/"/"/g;
        }
        $FORM{'ment'} =~ s/rn/<br>/g;
        print MAIL "To: $FORM{'+ '+ 'tomail'}n";
        print MAIL "From: $FORM{'myname'} <$FORM{'mymail'}>n";
        print MAIL "Subject:  $FORM{'title'}n";
    print MAIL "Content-type: text/htmlnn";
        print MAIL "<style type=text/css>n";
        print MAIL "a:link, a:visited, a:active { font-size:9pt; text-decoration:none; color:blue; }n";
        print MAIL "a:hover { font-size:9pt; text-decoration:underline; color:red; }n";
        print MAIL "body, td  { font-size:9pt }n";
        print MAIL ".main {font-size:10pt}n";
        print MAIL "</style>n";
        print MAIL "<table width=100% border=10 bordercolor=white cellpadding=0 cellspacing=0 bgcolor=white><tr><td align=center>n";
        print MAIL "<table width=440 cellpadding=1 cellspacing=0 bgcolor=$color1>n";
        print MAIL "<tr><td height=20 align=center><font face=굴림 class=main> $FORM{'title'} </font></td></tr>n";
        print MAIL "<tr><td>n";        
        print MAIL "<table width=100% cellpadding=3 cellspacing=0 bgcolor=#ffffff>n";
        print MAIL "<tr><td bgcolor=$color2><font face=굴림 class=main>n";
        print MAIL "보낸 날짜: $date $time<br>n";
        print MAIL "보낸 사람: $FORM{'myname'} (IP:$ip)<br>n";
    print MAIL "보낸 장소: <a href=$home_url target=_blank>$home_url</a>n";
        print MAIL "</font></td></tr>n";        
        print MAIL "<tr><td>n";                
        print MAIL "<font face=굴림 class=main>$FORM{'+ 'ment'}<br><br>n";                
    print MAIL "</font></td></tr>n";
        print MAIL "</table>n";
        print MAIL "</td></tr>n";        
        print MAIL "</table></td></tr></table>n";
        close (MAIL);
}
exit;

sub ending_form{
        &head;
        print "<br><br><br><br><br><br><br><br><br><br><div align="left"><table border="0" cellspacing="0" width="500"><tr align="center"><td><p><font color=#200040>Thank you!!!<br> <br> 편지가 배달 되었습니다.</font><br>n";
        print "<form><a href=$homeframe></a><a href=$cgi_url onfocus="this.blur()"><b>Back</b></a>n";
        print "</td></tr></table></div>n";
        &foot;
}

sub write_form{
        &head;
print <<END;
<form method="post" action="$cgi_url">
<input type="hidden" name="gotomail" value="1">
<input type="hidden" name="prog" value="$mail_prog">
<input type="hidden" name="home_url" value="$home_url">
<div align=left>
<br><br><br>
<table border="1" topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 cellspacing=0 cellpadding=0 width="700">

<tr>
<td width="115" align=right>보내는 사람 이름  </td>
<td><p><input type="text" name="myname" value="" maxlength="10" size="40" onBlur="checkField(this)" onFocus="clearField(this)" style="background-color:white;border:1 solid gray"></td>
</tr>
<tr>
<td width="115" align=right>보내는 사람 메일  </td>
<td><p><input type="text" name="mymail" value="" maxlength="50" size="40" onBlur="checkField(this)" onFocus="clearField(this)" style="background-color:white;border:1 solid gray"></td>
</tr>
<tr>
</tr>
<tr>
<td width="115" align=right>받는 사람 메일  </td>
<td><p><input type="text" name="tomail" value="$to_mail" maxlength="50" size="40" onBlur="checkField(this)" onFocus="clearField(this)" style="background-color:white;border:1 solid gray"></td>
</tr>
<tr>
<td width="115" align=right>제목  </td>
<td>
<p><input type="text" name="title" value="" maxlength="20" size="70" onBlur="checkField(this)" onFocus="clearField(this)" style="background-color:white;border:1 solid gray"><input type=checkbox name=html value=1><font color=#200040>html</font>
</td>
</tr>
<td width="115" align=right>내용  </td>
<td>
<p><textarea name="ment" rows="25" cols="80" wrap="virtual" style="background-color:white;border:1 solid gray">
⊙ 이  름 :
⊙ 나  이 :
⊙ 성  별 :
⊙ 주  소 :
⊙ 학교/직장 :

⊙ 연락처/핸드폰 :
⊙ E-mail :

⊙ 키/몸무게 :
⊙ 특기 :
⊙ 경력사항 :
⊙ 희망분야 (가수,연기,댄스,VJ) :

⊙ 부모님 동의여부 (미성년자일 경우) :
   </textarea></td>
</tr><tr>
<td width="115" align=right>
<p><font size="2"> </font></td>
<td>
<p><input type="submit" value="Send" style="color:black;background-color:#F4F4F4;border:1 solid black;height:19px" onfocus="this.blur()"> <input type="reset" value="Reset" style="color:black;background-color:#F4F4F4;border:1 solid black;height:19px" onfocus="this.blur()"></td>
</tr>
</table>
</div>
</form>
</body>
</html>
END
        &foot;
}

sub get_time{
        ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
        if($year < 2000){
                if($year >= 100){
                        $year=($year-100)+2000;
                }
                else{
                        $year=2000+$year;
                }
        }
        $month = ($mon + 1);
if($hour > 12) {
                $hour = $hour - 12;
                $hour = "오후 $hour";
    }
    else{
                $hour = "오전 $hour";
    }

        $date = "$year년 $month월$mday일";
        $time = "$hour시$min분";
}


1;

===========================소스 끝 ===========================
글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
녹차닢 도와주세요..  
녹차닢 XE ID/PW 찾기 오류  
Springdance 500 에러 때문에 질문드립니다. [2] 2016.10.24 by Springdance
너굴 업데이트 했더니.. 에러가 나고 아무것도 안떠요...ㅠㅠ 도와주세요..ㅠ [5] 2016.10.13 by 김전설
ryuking css 파일을 서버에 게시후 html 파일에서 불러오고 싶습니다. [1] 2016.09.29 by SimpleCode
jaes**** HTTP 500 내부 서버 오류 문제 해결방법  
미미미2 익명게시판에서 닉네임이 랜덤으로 바뀌는 애드온을 사용했는데요! [2] 2016.08.26 by 미미미2
펭구 [긴급 도움 요청] 레이아웃 하단부에 코드가 뜹니다. [1] 2016.08.26 by 초보해외유저
사계절 XE설치중 DB에 연결할수 없습니다란 오류가 뜹니다, 도와주세요. [5] file 2016.08.19 by 사계절
홍찬 xe 경고메세지 페이지로 보내는 방법 file  
NoAngel 회원가입 폼과 로그인창 가로 길이 변경이요 [5] 2016.08.07 by NoAngel
물렁이2 메인페이지 위치좀 알려주세요. [2] 2016.08.04 by 물렁이2
반장 제로보드4 질문드립니다 게시판 반투명하게 [2] 2016.07.27 by 반장
몽니 메인페이지 내용직접추가 html 적용방법좀 알려주세요 [2] file 2016.07.22 by DoorWeb
woohwa99 오류 어떻게 수정할수 있을까요? [3] 2016.07.20 by woohwa99
김기정746 contact_write 설정 꼭좀 부탁 드려요 ㅜㅜ 제발. . [2] file 2016.07.14 by 김기정746
별님왕자 #2038 , #500에러가 계속 발생해요. [5] 2016.07.13 by mAKEkr
베놈커뮤니티 카운터 하루 1회를 중복(페이지뷰)으로 변경하고 싶습니다.  
베놈커뮤니티 카운터 위젯 방문자를 페이지뷰로 바꾸고 싶습니다. file  
뀨뀨귱뀨뀨 로그인/관리자 로그인이 아예 안됩니다 ㅠㅠ file