메인 페이지에 견적문의 같은 폼메일을 넣고싶습니다. 그래서 넣었는데 문제가... 채택완료
http://sir.co.kr/qa/56203?vpage=1#answer_56217" target="_self">http://sir.co.kr/qa/56203?vpage=1#answer_56217 이 자료를 참고해서 메인 페이지에 폼 메일을 넣었는데요...
</p><p style="font-size: 14.6667px;"><?</p><p style="font-size: 14.6667px;">include_once(G5_PATH."/lib/mailer.lib.php");</p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>echo <<< HEREDOC</p><p style="font-size: 14.6667px;"> </p><p style="font-size: 14.6667px;">HEREDOC;</p><p style="font-size: 14.6667px;"> </p><p style="font-size: 14.6667px;">if ($mail) {</p><p style="font-size: 14.6667px;"> check_token();</p><p style="font-size: 14.6667px;"> $send_name = "Contact Us";</p><p style="font-size: 14.6667px;"> $form_email = $from_email;</p><p style="font-size: 14.6667px;"> $email = explode(",", $mail);</p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>$sub ="$name, $number, $content, $from_email";</p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span></p><p style="font-size: 14.6667px;"> for ($i=0; $i < count($email); $i++) {</p><p style="font-size: 14.6667px;"> mailer($send_name, $from_email, trim($email[$i]), "이메일 제목", $sub);</p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span></p><p style="font-size: 14.6667px;"> echo <<< HEREDOC</p><p style="font-size: 14.6667px;"> <script type="text/javascript"></p><p style="font-size: 14.6667px;"> alert("예약상담이 접수 되었습니다.");</p><p style="font-size: 14.6667px;"> </script></p><p style="font-size: 14.6667px;">HEREDOC;</p><p style="font-size: 14.6667px;">}</p><p style="font-size: 14.6667px;"> </p><p style="font-size: 14.6667px;">$token = get_token();</p><p style="font-size: 14.6667px;">?></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><div class="formmail"></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><form name="fsendmailtest" method="post" onsubmit="return check();"></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><input type="hidden" name="token" value="<?= $token ?>"></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><table></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><tr></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><th><label for="from_email">보내는 사람</label></th></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><td><span><input type="text" name="from_email" /></span></td></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span></tr></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><tr></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><th><label for="name">이름</label></th></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><td><span><input type="text" name="name" value="이름"></span></td></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span></tr></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><tr></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><th><label for="number">연락처</label></th></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><td><span><input type="text" name="number" value="연락처"></span><td></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span></tr></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><tr></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><th><label for="content">내용</label></th></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><td><span><textarea name="content" id="content">내용</textarea></span></td></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span></tr></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><tr></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><td style="display:none;"><input type="text" class="ed" name="mail" size="30" required itemname="E-mail" value="이메일주소"></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span></tr></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span></table></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><input type="submit" value="예약상담"></p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span></form> </p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;"> </span></div><!-- // formmail --></p><p style="font-size: 14.6667px;">
이렇게 했는데, 뒤로가기를 누르면 이메일을 보냈다는 팝업이 한번 더 뜹니다.

최초로 눌렀을땐 메일이 잘 갑니다. 뒤로가기를 누르면 저렇게 또 팝업이 뜨긴 하는데...
근데 메일은 또 안날라오구요...(다행)
이거를 어떻게 할 수 있는 방법이 없을까요?
untitled.php 만들어서 그 안에
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>
<meta http-equiv="Pragma" content="no-cache"/>
넣어주고 바로 location.href="사이트 주소" 해주면 되는건가요?
그래서 그렇게 했습니다.
untitled.php
</span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"><!doctype html></span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"><html lang="ko"></span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"><head></span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"><meta charset="UTF-8"></span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"><meta http-equiv="X-UA-Compatible" content="IE=edge"></span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"><meta http-equiv="Cache-Control" content="no-cache"/></span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"><meta http-equiv="Expires" content="0"/></span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"><meta http-equiv="Pragma" content="no-cache"/></span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"><title>Contact Us</title></span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"></head></span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"><body></span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"><span class="Apple-tab-span" style="white-space: pre;"> </span><script type="text/javascript"></span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>alert("예약상담이 접수 되었습니다.");</span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"><span class="Apple-tab-span" style="white-space: pre;"> </span> location.href = "index.php";</span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"><span class="Apple-tab-span" style="white-space: pre;"> </span></script></span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"></body></span></p><p style="font-size: 14.6667px;"> </p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"></html></span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px;">
근데 href 주소를 /index.php혹은 index.php를 해도 페이지를 찾을 수 없다는 에러가 나옵니다...
http://xn--hq1bm8jhe834c.com/%ED%8F%B4%EB%8D%94%EB%AA%85/(theme/basic/index.php)%EC%97%90">http://도메인명.com/폴더명/(theme/basic/index.php)에 위치하고 있습니다.
그래서 untitled.php를 루트에 넣었더니 잘 실행됩니다!
</span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"> echo <<< HEREDOC</span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"> <script type="text/javascript"></span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"> location.href = "untitled.php";</span></p><p style="font-size: 14.6667px;"> </p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;"> </script></span></p><p style="font-size: 14.6667px;"><span style="font-size: 14.6667px; line-height: 22.0001px;">
근데 문제가 보내는 사람, 이름, 연락처, 내용을 다 쓰고 뒤로가기를 누르면 저렇게 팝업은 안뜨는데
인풋이나 텍스트에리어에 남겼던 내용이 그대로 보여지는데 이건 어떻게 해야하는지요 ㅠㅠ..
저 캐쉬제거 메타태그를 넣어줌으로서 임시로 저 팝업창 또 뜨는건 해결했지만
인풋에 작성했던 텍스트가 남는건 해결이 안되네요....
어떻게 해야할까요..?
어떻게 해결해야 할까요...?
답변 2개
답변을 작성하려면 로그인이 필요합니다.
로그인