폼메일 전송 후, 페이지 넘어가는 문제
메일을 보내면 전송은 되는데... 전송 후, 페이지가 넘어가면서

이런 화면이 뜹니다ㅠㅠ
보통은 전송 후, 메인페이지에 전송 아랫부분에 전송이 성공했는지 여부가 뜨거나, 팝업창으로 그 여부가 뜨지 않나요?? 그런데.........이렇게 뜹니다........
위의 방법으로 뜨게 하고 싶은데...
어떻게 해결해야하나요ㅠㅠ
★★★이게 contact .php입니다.★★★
$string = file_get_contents("config.json"); $option = json_decode($string);
define("MAIL_HOST", $option->MAIL_HOST); define("MAIL_TITLE", $option->MAIL_TITLE);
if( isset($_POST['name']) && isset($_POST['email']) && isset($_POST['msg'])){ $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $msg = nl2br($_POST['msg']); if (MAIL_HOST != null) { $to = MAIL_HOST; } else { $to = "1234@gmail.com"; } $from = $email; if (MAIL_TITLE != null) { $subject = MAIL_TITLE; } else { $subject = '[] Contact Form Message'; } $message = 'Name: '.$name.' Email: '.$email.' Phone: '.$phone.'
'.$msg.'
'; $headers = "From: $from\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-type: text/html; charset=UTF-8"; if( mail($to, $subject, $message, $headers) ) { $serialized_data = '{"type":"success", "message":"Contact form successfully submitted. Thank you, I will get back to you soon!"}'; echo $serialized_data; } else { $serialized_data = '{"type":"error", "message":"Contact form failed. Please send again later!"}'; echo $serialized_data; } };
★★★contact.json 코드 입니다.★★★
{ "MAIL_HOST": "1212@naver.com", "MAIL_TITLE": "[Oragnive] Contact Form Message" }
★★★Index.php 코드 입니다. (메인 화면)★★★
E-Mail Me!!
답변 1개
$serialized_data = '{"type":"success", "message":"Contact form successfully submitted. Thank you, I will get back to you soon!"}'; 여기서 바꿔주면되요 어렵지도 않는건데.. 좀더 파악하면될듯해요
답변에 대한 댓글 2개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인