0
좋아, 나는 팝업 상자 안에 앉는 양식이있다. 양식을 성공적으로 제출하면 팝업 메시지 상자 안에 확인 메시지를 표시하고 싶습니다.양식 제출을 원래 양식으로 리디렉션하는 방법
어떻게하면됩니까?
는 내가 일하고 사이트 라이브를 가지고, 당신이 사이트에 도착하면, 여기 www.firestarmediallc.com
를 살펴 페이지 상단에 GET 견적 링크를 클릭하고 상자가 나타납니다.
실제로 우편물 기능을 살펴보고 그 기능이 올바른지 살펴 본다면 정말 멋지게 될 것입니다. 나는이 양식을 지난 이틀간 기능적으로 만들려고 노력했지만 아무런 운이 없었습니다.
죄송합니다. 방금 PHP 파일을 볼 수 없음을 알았습니다. 미리 감사드립니다. 이 사이트는로드되지 것
<?php
if(isset($_POST['email'])) {
// EDIT THE 2 LINES BELOW AS REQUIRED
$email_to = "[email protected]";
$email_subject = "Quote Request";
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}
// validation expected data exists
if(!isset($_POST['name']) ||
!isset($_POST['email']) ||
!isset($_POST['phone']) ||
!isset($_POST['comments'])) {
died('We are sorry, but there appears to be a problem with the form you submitted.');
}
$first_name = $_POST['name']; // required
$email_from = $_POST['email']; // required
$telephone = $_POST['phone']; // not required
$comments = $_POST['comments']; // required
$error_message = "";
$email_exp = "^[A-Z0-9._%-][email protected][A-Z0-9.-]+\.[A-Z]{2,4}$";
if(!eregi($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
$string_exp = "^[a-z .'-]+$";
if(!eregi($string_exp,$first_name)) {
$error_message .= 'The Name you entered does not appear to be valid.<br />';
}
if(strlen($comments) < 2) {
$error_message .= 'The Comments you entered do not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "Name: ".clean_string($name)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "Telephone: ".clean_string($phone)."\n";
$email_message .= "Comments: ".clean_string($comments)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
$('#contactform').submit(function() {
sendContactForm();
return false;
});
<?php
}
?>
, 나를 위해 잘로드 있기 때문이다. 이것은 나를 위해 문제가 될 수 있습니다. : –
처음에는 네트워크 연결에 문제가 있었지만 초기 연결 시도에 매달려있었습니다 –
팝업은 문서 형식의 것입니다. window.open으로 만든 실제 팝업 창을 의미하는 것으로 생각했습니다.)'또는 무엇이든간에. 해당 팝업의 범위 내에서 양식 제출을 작동 시키려면 AJAX를 통해 양식 제출을해야합니다. –