게시글 작성시 시간이 오래 걸립니다.
본문
위 이미지처럼 메인화면에서 간단히 상담신청 게시글을 적게
form.php 파일을 인크루드 시켜 적용했습니다.
게시글 작성은 정상적으로 이루어 집니다.
하지만 상담신청을 클릭한 후 게시글 작성까지 한참 시간이 걸립니다.
아래 작동 파일 소스 첨부 합니다..
버퍼링이 걸리는 이유가 멀까요??
아래는 form.php 파일소스입니다.
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
?>
<style>
.parallaxCover3 {
padding: 60px 0;
width: 100%;
height: auto;
color: #fff;
}
.anb-parallax-3 {background-position: center; background-repeat: no-repeat;}
.anb-contact {font-family: Segoe UI,SegoeUI,Microsoft YaHei,Helvetica Neue,Hiragino Sans GB,Heiti SC,Helvetica,Arial,sans-serif,Roboto !important;}
.anb-contact li { display: flex; margin: 30px 0; }
.anb-contact .form-control {
background: #161f26;
color: #FFF;
font-weight: 700;
border-color: transparent;
border-radius: 4px !important;
}
.anb-contact .form-group input, .form-group textarea {
padding: 15px;
}
.anb-contact .form-group input.form-control {
height: auto;
}
.anb-contact ::-webkit-input-placeholder {
text-transform: uppercase;
font-weight: 700;
color: #eeeeee;
opacity: 1;
}
.anb-contact :-moz-placeholder {
text-transform: uppercase;
font-weight: 1000;
color: #eeeeee;
opacity: 1;
}
.anb-contact ::-moz-placeholder {
text-transform: uppercase;
font-weight: 700;
color: #eeeeee;
opacity: 1;
}
.anb-contact :-ms-input-placeholder {
text-transform: uppercase;
font-weight: 700;
color: #eeeeee;
opacity: 1;
}
.anb-contact ::placeholder {
text-transform: uppercase;
font-weight: 700;
color: #eeeeee;
opacity: 1;
}
.anb-contact .form-group textarea.form-control {
height: 160px;
}
.anb-contact {
scrollbar-face-color: #6a6b6d;
scrollbar-shadow-color: #77787b;
scrollbar-highlight-color: #77787b;
scrollbar-3dlight-color: #2a2b30;
scrollbar-darkshadow-color: #2a2b30;
scrollbar-track-color: #2a2b30;
scrollbar-arrow-color: #6f7073;
}
.anb-contact ::-webkit-scrollbar{
width: 10px;
}
.anb-contact ::-webkit-scrollbar-thumb{
background: #666; border-radius: 20px;
}
.anb-contact ::-webkit-scrollbar-track{
background: #8e8e8e; border-radius: 20px;
}
.anb-contact .anb-submit {
background-color: #007db6; border-color: #0072a6;border-radius: 4px !important;
}
.anb-contact .anb-submit:hover{
background-color: #00628f; border-color: #005378; color:#fff;
}
#anb-contact { height:100%;overflow:scroll; overflow-x:hidden;}
</style>
<font size="4">* 무엇이든 물어보세요 *</font><br>
<form name="fwrite" method="post" onSubmit="return submitChk(this)">
<input type=hidden name=sca value="<?=$sca?>">
<div class="form-group">
<input type="name" name='wr_name' class="form-control" placeholder="성함을 입력해 주세요 *" id="anb-contact-name" required="name" data-validation-required-message="성함을 입력해 주세요 (Please enter your name.)" aria-invalid="false" maxlength="20">
<p class="help-block text-danger"></p>
</div>
<div class="form-group">
<input type="email" name='wr_email' class="form-control" placeholder="메일주소 적어주세요 *" id="anb-contact-email" required="email" data-validation-required-message="메일주소 적어주세요 (Please enter your email address.)" aria-invalid="false" onKeypress="if((event.keyCode<48||event.keyCode>57)&&
(event.keyCode<64||event.keyCode>90)&&(event.keyCode<97||event.keyCode>122)&&event.keyCode!
=46)event.returnValue=false">
<p class="help-block text-danger"></p>
</div>
<div class="form-group">
<input type="tel" name='wr_2' class="form-control" placeholder="휴대폰 번호 입력하세요 *" id="anb-contact-phone" required="phone" data-validation-required-message="휴대폰 번호 입력하세요 (Please enter your phone number.)" oninput="maxLengthCheck(this)" onkeyup="onlynumberic(event)" aria-invalid="false" maxlength="11">
<p class="help-block text-danger"></p>
</div>
<div class="form-group">
<textarea name="wr_content" class="form-control" placeholder="상담내용을 입력하세요 *" id="anb-contact-message" required="message" data-validation-required-message="상담내용을 입력하세요 (Please enter a message.)" aria-invalid="false"></textarea>
<p class="help-block text-danger"></p>
</div>
<div class="icenter">
<span class="form_span2"><label><input type="checkbox" name="wr_9" required value="1"<?php echo ($write['wr_9'] == "1") ? " checked" : "";?>> <b>개인정보수집이용에 동의합니다.</b></label></span>
</div>
<div class="text-center anb-contact"><br>
<button type="submit" class="btn white anb-submit" style="width: 300px; height: 50px; background-color: #D90003"><b><font size="5">상담 신청</font></b></button>
<div class="iclear"><input type="hidden" name="secret" value="secret"></div>
</div>
</form><br>
<script language="javascript">
$(document).ready(function(e) {
$('.anb-submit').click(function(){
var sName = $('#anb-contact-name').val();
var sEmail = $('#anb-contact-email').val();
var sPhone = $('#anb-contact-phone').val();
var sMessage = $('#anb-contact-message').val();
if ($.trim(sName).length == 0) {
alert('성함을 입력해 주세요');
return;
}
if ($.trim(sEmail).length == 0) {
alert('메일주소 적어주세요');
return;
}
if ($.trim(sPhone).length == 0) {
alert('휴대폰 번호 입력하세요');
return;
}
if ($.trim(sMessage).length == 0) {
alert('상담내용을 입력하세요');
return;
}
if (validateEmail(sEmail)) {
ajax_contact2 ();
}else {
alert('메일주소 틀렸습니다');
return;
}
});
});
function validateEmail(sEmail) {
var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
if (filter.test(sEmail)) {
return true;
}
else {
return false;
}
}
function ajax_contact2 (){
var sName = $('#anb-contact-name').val();
var sEmail = $('#anb-contact-email').val();
var sPhone = $('#anb-contact-phone').val();
var sMessage = $('#anb-contact-message').val();
if(data.result == 'success' ){
//성공시 폼삭제
$('#anb-contact-name').val('');
$('#anb-contact-email').val('');
$('#anb-contact-phone').val('');
$('#anb-contact-message').val('');
alert(data.msg);
}
}
//maxlength 체크
function maxLengthCheck(object){
if (object.value.length > object.maxLength){
object.value = object.value.slice(0, object.maxLength);
}
}
//숫자만남기고제거
function onlynumberic(event) {
event.target.value = event.target.value.replace(/[^0-9]/g, "");
}
function submitChk(f)
{
f.action = "../form_ok.php";
return true;
}
</script>
아래는 form_ok.php 파일소스입니다.
<?php
include_once('./_common.php');
if(!defined('_GNUBOARD_')) exit; // 禁止个别用户访问
if ($member['mb_id']) {
$mb_id = $member['mb_id'];
if (!$wr_name)
alert('고객님 이름을 입력하세요.');
$wr_email = get_email_address(trim($_POST['wr_email']));
$as_level = 1;
if($member['mb_open']) {
$wr_email = addslashes($member['mb_email']);
} else {
if (!$wr_email)
alert('메일주소 입력하세요.');
}
$as_level = (int)$member['as_level'];
} else {
$mb_id = '';
// 비회원시
$wr_name = clean_xss_tags(trim($_POST['wr_name']));
if (!$wr_name)
alert('고객님 이름을 입력하세요.');
$wr_email = get_email_address(trim($_POST['wr_email']));
$as_level = 1;
}
$wr_content = '';
if (isset($_POST['wr_content'])) {
$wr_content = substr(trim($_POST['wr_content']),0,65536);
$wr_content = preg_replace("#[\\\]+$#", "", $wr_content);
}
if ($wr_content == '') {
$msg[] = '<strong>내용입력</strong>필수 입니다.';
}
include_once("./lib/mailer.lib.php");
ob_start();
include_once ("./seolin/write_update_mail.php");
$content = ob_get_contents();
ob_end_clean();
$bo_table = "aaaa";
$write_table = $g5['write_prefix'] . $bo_table;
$wr_num = get_next_num($write_table);
$wr_reply = "";
$wr_subject = "{$_POST[wr_name]} 님의 빠른 상담 요청 글입니다";
//$secret = "secret";
$sql = " insert into $write_table
set wr_num = '$wr_num',
wr_reply = '$wr_reply',
wr_comment = 0,
ca_name = '$ca_name',
wr_option = '$html,$secret,$mail',
wr_subject = '$wr_subject',
wr_content = '$wr_content',
wr_link1 = '$wr_link1',
wr_link2 = '$wr_link2',
wr_link1_hit = 0,
wr_link2_hit = 0,
wr_hit = 0,
wr_good = 0,
wr_nogood = 0,
mb_id = '{$member['mb_id']}',
wr_password = '$wr_password',
wr_name = '$wr_name',
wr_email = '$wr_email',
wr_homepage = '$wr_homepage',
wr_datetime = '".G5_TIME_YMDHIS."',
wr_last = '".G5_TIME_YMDHIS."',
wr_ip = '{$_SERVER['REMOTE_ADDR']}',
wr_1 = '$wr_1',
wr_2 = '$wr_2',
wr_3 = '$wr_3',
wr_4 = '$wr_4',
wr_5 = '$wr_5',
wr_6 = '$wr_6',
wr_7 = '$wr_7',
wr_8 = '$wr_8',
wr_9 = '$wr_9',
wr_10 = '$wr_10' ";
sql_query($sql);
$wr_id = sql_insert_id();
// 부모 아이디에 UPDATE
sql_query(" update $write_table set wr_parent = '$wr_id' where wr_id = '$wr_id' ");
// 새글 INSERT
sql_query(" insert into $g5[board_new_table] ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '$bo_table', '$wr_id', '$wr_id', '$g4[time_ymdhis]', '$member[mb_id]' ) ");
// 게시글 1 증가
sql_query("update $g5[board_table] set bo_count_write = bo_count_write + 1 where bo_table = '$bo_table'");
$super_admin = get_admin("super");
$wr_email = $super_admin[mb_email];
mailer($wr_name, $wr_email, $super_admin[mb_email], $wr_subject, $content, 1);
//alert("빠른 상담 요청이 등록되었습니다. 금방 연락드릴께요!","/");
alert("빠른 상담 요청이 등록되었습니다. 금방 연락드릴께요!");location.reload();
?>
!-->!-->
답변을 작성하시기 전에 로그인 해주세요.