다시 한번 폼메일에 대해서.. > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

다시 한번 폼메일에 대해서.. 정보

다시 한번 폼메일에 대해서..

본문

3가지를 물어보고 싶습니다.

1.폼메일에서 수신자 선택 없이 자동으로 지정한 메일로 갈 수 있도록 하는 방법이 있을까요?
http://www.sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=37073&sca=%C6%FB%B8%DE%C0%CF

위의 폼메일을 사용중인데, 수동으로 수신자를 선택하게 되어있습니다.
수신자 선택란을 없애버리고 보내기를 눌렀을때 지정한 메일(*** 개인정보보호를 위한 이메일주소 노출방지 ***)로 자동으로 갈수있도록 하는 방법을 알고싶습니다.

2.폼메일에서 보내기를 누르면 이상하게도 관리자페이지가 나옵니다.
가령, Q&A에서 보내기를 눌렀을때, 다시 Q&A 즉 제자리로 돌아오도록 수정할려면 어떤 방법이 있을지요.

3.폼메일에서 보내기만 눌러도 성공적으로 보냈습니다,라는 문구가 뜨고 있습니다.
  내용을 아무것도 안 적었는데 말이죠.
  내용에 충실히 기입하지 못하면 무엇이 빠졌다는 에러 내용이 나왔으면 좋겠습니다.

질문의 내용과 달리 포인트가 적어서 죄송합니다.

지금 포인트가 2,519라;;;;

다시 한번 부탁드립니다.

감사합니다.
  • 복사

댓글 전체

1. <select> 부분을 다 삭제 하시고
관리자<input type=hidden name=셀렉트에있던name value="*** 개인정보보호를 위한 이메일주소 노출방지 ***">

2. 소스를 안봐서 잘.........^^;

3. 그누보드에는 input에 사용하는 다양한 속성이 있습니다... 그중 필수 입력 조건을 만들어주는
    required 라는 것이 있으니 사용 해보세요~
<input ~~~~~~~~~~ required> 를 붙이시면 form 전송시 자동으로 필수요건으로 체크 하게 됩니다
http://도메인.com/gnuboard4/formmail_skin.contacts.php
지금 홈페이지에 걸려있는 폼메일 경로구요.

http://도메인.com/gnuboard4/skin/board/cheditor
ftp에서 폼메일이 저정된 경로 입니다.

그리고 skin/member/basic/formmail.skin.php 소스는
<?
if (!defined("_GNUBOARD_")) exit; // °³º° Æ&auml;&Agrave;&Igrave;&Aacute;&ouml; &Aacute;&cent;±&Ugrave; º&Ograve;°¡

include_once("$g4[path]/lib/cheditor.lib.php");
$content = '';
?>
<script src="<?=$member_skin_path?>/cheditor.js"></script>
<?=cheditor1('content', $content);?>

<table width="600" height="50" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td align="center" valign="middle" bgcolor="#EBEBEB"><table width="590" height="40" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="25" align="center" bgcolor="#FFFFFF" ><img src="<?=$member_skin_path?>/img/icon_01.gif" width="5" height="5"></td>
                    <td width="75" align="left" bgcolor="#FFFFFF" ><font color="#666666"><b><?=$g4[title]?></b></font></td>
                    <td width="490" bgcolor="#FFFFFF" ></td>
                </tr>
            </table></td>
    </tr>
</table>

<table width="600" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td width="600" height="20" colspan="4"></td>
    </tr>
    <tr>
        <td width="30" height="24"></td>
        <td width="20" align="center" valign="middle" bgcolor="#EFEFEF"><img src="<?=$member_skin_path?>/img/arrow_01.gif" width="7" height="5"></td>
        <td width="520" align="left" valign="middle" bgcolor="#EFEFEF"><b><?=$name?></b>´&Ocirc;²² ¸Þ&Agrave;&Iuml;º¸³&raquo;±&acirc;</td>
        <td width="30" height="24"></td>
    </tr>
</table>

<table width="600" border="0" cellspacing="0" cellpadding="0">
<form name="fformmail" method="post" action="javascript:fformmail_submit(document.fformmail);" enctype="multipart/form-data">
<input type="hidden" name="to"    value="<?=$email?>">
<input type="hidden" name="attach" value="2">

<tr>
    <td height="330" align="center" valign="top"><table width="540" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td height="20"></td>
        </tr>
        <tr>
            <td height="2" bgcolor="#808080"></td>
        </tr>
        <tr>
            <td width="540" height="2" align="center" valign="top" bgcolor="#FFFFFF">
                <table width="540" border="0" cellspacing="0" cellpadding="0">
               
                <? if ($is_member) { // &Egrave;¸¿ø&Agrave;&Igrave;¸&eacute; ?>
                <input type='hidden' name='fnick'  value='<?=$member[mb_nick]?>'>
                <input type='hidden' name='fmail'  value='<?=$member[mb_email]?>'>
                <? } else { ?>
                <tr>
                    <td width="80" height="27" align="center"><b>&Agrave;&Igrave;¸§</b></td>
                    <td width="10" valign="bottom"><img src="<?=$member_skin_path?>/img/l.gif" width="1" height="8"></td>
                    <td width="450"><input type=text style='width:90%;' name='fnick' required minlength=2 itemname='&Agrave;&Igrave;¸§'></td>
                </tr>
                <tr>
                    <td width="80" height="27" align="center"><b>E-mail</b></td>
                    <td width="10" valign="bottom"><img src="<?=$member_skin_path?>/img/l.gif" width="1" height="8"></td>
                    <td width="450"><input type=text style='width:90%;' name='fmail' required email itemname='E-mail'></td>
                </tr>
                <? } ?>

                <tr>
                    <td width="80" height="27" align="center"><b>&Aacute;&brvbar;¸&ntilde;</b></td>
                    <td width="10" valign="bottom"><img src="<?=$member_skin_path?>/img/l.gif" width="1" height="8"></td>
                    <td width="450"><input type=text style='width:90%;' name='subject' required itemname='&Aacute;&brvbar;¸&ntilde;'></td>
                </tr>
                <tr>
                    <td height="1" colspan="3" bgcolor="#E9E9E9"></td>
                </tr>
                <tr>
<input type='hidden' name='type' value='2'>
                    <td width="80" height="150" align="center"><b>³&raquo;¿&euml;</b></td>
                    <td width="10" valign="bottom"><img src="<?=$member_skin_path?>/img/l.gif" width="1" height="8"></td>
                    <td width="450"><?=cheditor2('fformmail', 'content', '90%', '200');?></td>
                </tr>
                <tr>
                    <td height="1" colspan="3" bgcolor="#E9E9E9"></td>
                </tr>
                <tr>
                    <td width="80" height="27" align="center">&Atilde;·º&Icirc;Æ&Auml;&Agrave;&Iuml; #1</td>
                    <td width="10" valign="bottom"><img src="<?=$member_skin_path?>/img/l.gif" width="1" height="8"></td>
                    <td width="450"><input type=file style='width:90%;' name='file1'></td>
                </tr>
                <tr>
                    <td height="1" colspan="3" bgcolor="#E9E9E9"></td>
                </tr>
                <tr>
                    <td width="80" height="27" align="center">&Atilde;·º&Icirc;Æ&Auml;&Agrave;&Iuml; #2</td>
                    <td width="10" valign="bottom"><img src="<?=$member_skin_path?>/img/l.gif" width="1" height="8"></td>
                    <td width="450"><input type=file style='width:90%;' name='file2'></td>
                </tr>
                <tr>
                    <td height="1" colspan="3" bgcolor="#E9E9E9"></td>
                </tr>
                </table></td>
        </tr>
        </table></td>
</tr>
<tr>
    <td height="2" align="center" valign="top" bgcolor="#D5D5D5"></td>
</tr>
<tr>
    <td height="2" align="center" valign="top" bgcolor="#E6E6E6"></td>
</tr>
<tr>
    <td height="40" align="center" valign="bottom"><input id=btn_submit type=image src="<?=$member_skin_path?>/img/btn_mail_send.gif" border=0>&nbsp;&nbsp;<a href="javascript:window.close();"><img src="<?=$member_skin_path?>/img/btn_close.gif" width="48" height="20" border="0"></a></td>
</tr>
</form>
</table>

<script language="JavaScript">
with (document.fformmail) {
    if (typeof fname != "undefined")
        fname.focus();
    else if (typeof subject != "undefined")
        subject.focus();
}

function fformmail_submit(f)
{
    if (f.file1.value || f.file2.value) {
        // 4.00.11
        if (!confirm("&Atilde;·º&Icirc;Æ&Auml;&Agrave;&Iuml;&Agrave;&Ccedil; ¿&euml;·?&Agrave;&Igrave; &Aring;&laquo;°æ¿&igrave; &Agrave;&uuml;¼&Ucirc;½&Atilde;°&pound;&Agrave;&Igrave; ¿&Agrave;·¡ °&Eacute;¸³´&Iuml;´&Ugrave;.\n\n¸Þ&Agrave;&Iuml;º¸³&raquo;±&acirc;°¡ ¿&Iuml;·&aacute;&micro;&Ccedil;±&acirc; &Agrave;&uuml;¿¡ &Atilde;&cent;&Agrave;&raquo; ´&Yacute;°&Aring;³ª &raquo;&otilde;·&Icirc;°&iacute;&Auml;§ &Ccedil;&Iuml;&Aacute;&ouml; ¸¶½&Ecirc;½&Atilde;¿&Agrave;."))
            return;
    }

    document.getElementById('btn_submit').disabled = true;

<?=cheditor3('content');?>

f.action = "./formmail_send.php";
    f.submit();
}
</script>

이것입니다.

너무 많은걸 부탁드리네요.

죄송합니다.
필수입력을 사용하시려면 이걸사용하시는게 좋구요
http://www.sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=47084&sca=%C6%FB%B8%DE%C0%CF

sjs_fumail_update.php 맨 아래줄 보시면 메일 보낸후 어디로 갈지 정하는것이있습니다.

받는사람 보내는 사람 나누는것은 아래같이 하시면 됩니다.
<p align="left"><b>◎ 받는사람 정보</b>

<TABLE width='100%' border='1' bordercolor='#dbd7a2' cellpadding='4' cellspacing='0' style='border-collapse:collapse;'>
<col width="15%" style="font:bold;" bgcolor="#f8f7ee" align="center">
<col width="35%">


<tr>
<td>이름</td>
<td><input type='text' name='이름' size=20 required itemname="이름"></td>
<td><b>메일주소</b></td>
<td><input type='text' name='testemail' style="width:150;" email required itemname="메일주소">
</tr>
</TABLE>



<p align="left"><b>◎ 보내는사람 정보</b>

<TABLE width='100%' border='1' bordercolor='#dbd7a2' cellpadding='4' cellspacing='0' style='border-collapse:collapse;'>
<col width="15%" style="font:bold;" bgcolor="#f8f7ee" align="center">
<col width="35%">


<tr>
<td>이름</td>
<td><input type='text' name='이름' size=20 required itemname="이름"></td>
<td><b>메일주소</b></td>
<td><input type='text' name='보내는사람메일주소' style="width:150;" email required itemname="메일주소">
</tr>



</table>
혹시 skin/member/basic/formmail.send.php를 말씀하시는건가요.
그 경롱에선 formmail_send.php 가 없었어요.

그래서
도메인/gnuboard4/formmail_send.contacts.php 소스를 올렸습니다


<?
  $g4_another='yes';  //수정要
  $g4_dir='g4_another_room'; //위의 줄이 YES면 수정要. 마지막엔 / 슬래쉬 없습니다.
#
####################################################
$g4_now = $_SERVER['PHP_SELF'];
$g4_web = explode("/", $g4_now);
$g4_myname = array_pop($g4_web);
$g4_path_web = implode("/", $g4_web);
$g4_myurl = "http://".$_SERVER['HTTP_HOST'].$g4_path_web."/".$g4_myname;
$PAGE_BASE['www'] = $g4_myurl;
strstr( PHP_OS, "WIN") ? $g4_strPath = "\\" : $g4_str = "/";
$g4_path_file = getcwd ();
$PAGE_BASE['physical'] = $g4_path_file.$g4_str.$g4_myname;
$g4_www = $PAGE_BASE['www'];
$g4_physical = $PAGE_BASE['physical'];
####################################################
// echo "$g4_physical<p>"; // 물절주
// echo "$g4_www<p>";      // 웹절주
$g4_www = explode("/", $g4_www);
$g4_sz = sizeof($g4_www);

if($g4_another=='YES' && $g4_dir!='') 
 {$index_file=$g4_dir."/".'index.php';
  $_head_file=$g4_dir."/".'_head.php';
  $_com_file=$g4_dir."/".'_common.php';
 }else
 {$index_file='index.php';
  $_head_file='_head.php';
  $_com_file='_common.php';
 }
 for($g4_for=0; $g4_sz> $g4_for; $g4_for++){
 // 안아프게 배열에...넣어본다.
 // echo"$g4_www[$g4_for]</p>";
  if(file_exists($index_file)&&file_exists($_head_file)&& file_exists($_com_file)) 
    {  if($g4_for==0) {$g4_sang='.'; break;}
  else{$g4_sang=str_replace("index.php","",$index_file);
  $g4_sang_length=strlen($g4_sang); //길이를 얻는다.
  $g4_sang=substr($g4_sang,0,$g4_sang_length-1);//처음부터 마지막 1자이전까지               
  break;}       
    }else{$index_file="../".$index_file;
          $_head_file="../".$_head_file;
  $_com_file="../".$_com_file;}             
}//for
######################################################
#밑의 꺽쇠와 그 다음 걱쇠사이는 공라인이 없어야 됩니다.
#위의 echo step인 물절주등을 테스트하려면 아래의 인클루드 _head.php 를 막으세요.
?>
<?
 $g4_path = $g4_sang;
 include_once("$g4_path/common.php");
 include_once("$g4[path]/lib/latest.lib.php");
 $g4[title] = "붕붕족구단";
 include_once("$g4[path]/_head.php");
include_once("$g4[path]/lib/mailer.lib.php");
##########################################2005.12.10 dalsoo
?>
<?

referer_check();


$to = $email;



for ($i=1; $i<=$attach; $i++)
{
    if ($_FILES["file".$i][name])
        $file[] = attach_file($_FILES["file".$i][name], $_FILES["file".$i][tmp_name]);
}

$content = stripslashes($content);
if ($type == 2)
{
    $type = 1;
    $content = preg_replace("/\n/", "<br>", $content);
}

// html 이면
if ($type)
{
    $current_url = $g4[url];
    $mail_content = "<html><head><meta http-equiv='content-type' content='text/html; charset=$cfg[charset]'><title>메일보내기</title><link rel='stylesheet' href='$current_url/style.css' type='text/css'></head><body>$content</body></html>";
}
else
    $mail_content = $content;

//mailer($fnick, $fmail, $to, $subject, $mail_content, $type, $file, $cfg[charset]);
mailer($fnick, $fmail, $to, $subject, $mail_content, $type, $file);

//$html_title = $tmp_to . "님께 메일발송";
$html_title = "메일 발송중";
include_once("$g4[path]/head.sub.php");

alert("성공적으로 메일이 전송되었습니다. 빠른시간내에 연락드리겠습니다.",$g4[path]);

include_once("$g4[path]/tail.sub.php");
?>
© SIRSOFT
현재 페이지 제일 처음으로