코드 한번 봐주세요.
본문
https://sir.kr/g5_skin/12335?sfl=wr_subject%7C%7Cwr_content&stx=%EC%98%88%EC%95%BD
를 응용하여 글쓰기 페이지를 만들었는데
저장이 아래 세가지 값은 안되는데 이유를 아시나요?? 디비에 아예 찍히질 않아서요.
고수님들 부탁합니다.^^ 공부 좀 하는데 하루 다가네요.ㅋㅋ
wr_12
wr_21
wr_15
write.skin.php
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$board_skin_url.'/style.css">', 0);
add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
// 주소입력
$wr18 = explode('|',$write['wr_18']);
$ex_zip = $wr18[0];
$ex_addr1 = $wr18[1];
$ex_addr2 = $wr18[2];
$ex_addr3 = $wr18[3];
$ex_jibeon = $wr18[4];
?>
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/base/jquery-ui.css" rel="stylesheet" />
<style type="text/css">
<!--
.ui-datepicker { font:12px dotum; }
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year { width: 70px;}
.ui-datepicker-trigger { margin:0 0 -5px 2px; }
-->
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script>
<script type="text/javascript">
/* Korean initialisation for the jQuery calendar extension. */
/* Written by DaeKwon Kang (*** 개인정보보호를 위한 이메일주소 노출방지 ***). */
jQuery(function($){
$.datepicker.regional['ko'] = {
closeText: '닫기',
prevText: '이전달',
nextText: '다음달',
currentText: '오늘',
monthNames: ['1월(JAN)','2월(FEB)','3월(MAR)','4월(APR)','5월(MAY)','6월(JUN)',
'7월(JUL)','8월(AUG)','9월(SEP)','10월(OCT)','11월(NOV)','12월(DEC)'],
monthNamesShort: ['1월','2월','3월','4월','5월','6월',
'7월','8월','9월','10월','11월','12월'],
dayNames: ['일','월','화','수','목','금','토'],
dayNamesShort: ['일','월','화','수','목','금','토'],
dayNamesMin: ['일','월','화','수','목','금','토'],
weekHeader: 'Wk',
dateFormat: 'yy-mm-dd',
firstDay: 0,
isRTL: false,
showMonthAfterYear: true,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['ko']);
$('#wr_1').datepicker({
showOn: 'button',
buttonImage: '<?=$board_skin_url?>/img/calender.png',
buttonImageOnly: true,
buttonText: "달력",
changeMonth: true,
changeYear: true,
showButtonPanel: true,
yearRange: 'c-99:c+99',
minDate: '+0d',
maxDate: '+7200d'
});
$('#wr_2').datepicker({
showOn: 'button',
buttonImage: '<?=$board_skin_url?>/img/calender.png',
buttonImageOnly: true,
buttonText: "달력",
changeMonth: true,
changeYear: true,
showButtonPanel: true,
yearRange: 'c-99:c+99',
minDate: '+0d',
maxDate: '+7200d'
});
});
</script>
<style type="text/css">
#order_warp { width:100%; }
#order_warp .help { text-align:center; padding:15px 0; border:1px solid #cccccc; background:#eaeaea; }
#form11 { width:100%; margin:20px auto; padding:10px 10px 30px 10px; border:0px solid #cccccc;}
#form11 td { position:relative; }
#form11 .head { padding-left:15px;width:160px; color:#333333; font-weight:normal; height:45px;}
#form11 .input { border:none; border:1px solid #ccc; width:100px; padding:3px; height:auto; }
#form11 .input2 { border:none; border:1px solid #ccc; width:100%; padding:3px; height:auto; }
#form11 .input3 { border:none; border:1px solid #ccc; width:90px; padding:3px; height:auto; }
#form11 .input_text { border:1px solid #ccc; width:90%; padding:3px; }
#form11 .input_tel { border:none; border:1px solid #ccc; width:80px; padding:3px; height:auto; }
#form11 .input_email { border:none; border:1px solid #ccc; width:100px; padding:3px; height:auto; }
.btn { text-align:center; margin-top:20px;}
</style>
<script type="text/javascript">
function TextBoxInputLengthCheck(maxSize, contentname, textlimitname) {
var strCount = 0;
var tempStr, tempStr2;
var strCount = 0;
for (j = 0; j < document.getElementById(contentname).value.length; j++) {
var chr = document.getElementById(contentname).value.charAt(j);
strCount += (chr.charCodeAt() > 128) ? 2 : 1
}
if (strCount > maxSize) {
alert("최대 " + maxSize + "byte이므로 초과된 글자수는 자동으로 삭제됩니다.");
strCount = 0;
tempStr2 = "";
for (i = 0; i < document.getElementById(contentname).value.length; i++) {
tempStr = document.getElementById(contentname).value.charAt(i);
if (escape(tempStr).length > 4) strCount += 2;
else strCount += 1;
if (strCount > maxSize) {
if (escape(tempStr).length > 4) strCount -= 2;
else strCount -= 1;
break;
}
else tempStr2 += tempStr;
}
document.getElementById(contentname).value = tempStr2;
}
document.getElementById(textlimitname).innerHTML = strCount;
}
</script>
<section id="bo_w">
<!-- 게시물 작성/수정 시작 { -->
<form name="fwrite" id="fwrite" action="<?php echo $action_url ?>" onsubmit="return fwrite_submit(this);" method="post" enctype="multipart/form-data" autocomplete="off" style="width:<?php echo $width; ?>">
<input type="hidden" name="uid" value="<?php echo get_uniqid(); ?>">
<input type="hidden" name="w" value="<?php echo $w ?>">
<input type="hidden" name="bo_table" value="<?php echo $bo_table ?>">
<input type="hidden" name="wr_id" value="<?php echo $wr_id ?>">
<input type="hidden" name="wr_8" value="미승인">
<input type="hidden" name="sca" value="<?php echo $sca ?>">
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
<input type="hidden" name="stx" value="<?php echo $stx ?>">
<input type="hidden" name="spt" value="<?php echo $spt ?>">
<input type="hidden" name="sst" value="<?php echo $sst ?>">
<input type="hidden" name="sod" value="<?php echo $sod ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type=hidden name=wr_subject value="1">
<input type=hidden name=wr_content value="1">
<?php
$option = '';
$option_hidden = '';
if ($is_notice || $is_html || $is_secret || $is_mail) {
$option = '';
if ($is_notice) {
$option .= "\n".'<input type="checkbox" id="notice" name="notice" value="1" '.$notice_checked.'>'."\n".'<label for="notice">공지</label>';
}
if ($is_html) {
if ($is_dhtml_editor) {
$option_hidden .= '<input type="hidden" value="html1" name="html">';
} else {
$option .= "\n".'<input type="checkbox" id="html" name="html" onclick="html_auto_br(this);" value="'.$html_value.'" '.$html_checked.'>'."\n".'<label for="html">html</label>';
}
}
if ($is_secret) {
if ($is_admin || $is_secret==1) {
$option .= "\n".'<input type="checkbox" id="secret" name="secret" value="secret" '.$secret_checked.'>'."\n".'<label for="secret">비밀글</label>';
} else {
$option_hidden .= '<input type="hidden" name="secret" value="secret">';
}
}
if ($is_mail) {
$option .= "\n".'<input type="checkbox" id="mail" name="mail" value="mail" '.$recv_email_checked.'>'."\n".'<label for="mail">답변메일받기</label>';
}
}
echo $option_hidden;
?>
<style type="text/css">
.info { }
.title { font-size:18px; }
.scr { overflow-y:scroll; color:#777; margin:10px auto; padding:10px;border:1px solid #ccc; height:200px; text-align:left;}
.in { border:none;text-align:center; font-size:17px; font-weight:bold; padding:4px; background:#006600; color:#fff; }
</style>
<!--
<script language="javascript">
function termDate(){
f=document.fwrite;
v1=f.wr_1.value.split("-");
v2=f.wr_2.value.split("-");
a1=new Date(v1[0],v1[1]-1,v1[2]).getTime();
a2=new Date(v2[0],v2[1]-1,v2[2]).getTime();
b=(a2-a1)/(1000*60*60*24);
f.wr_15.value=b;
}
</script>
-->
<script language="javascript">
function showHide()
{
if ( fwrite.cc.checked ) {
document.all.layer.style.display = ""
} else {
document.all.layer.style.display = "none"
}
}
</script>
<div id="order_warp">
<span class="title">사용신청</span>
<table id="form11" style="margin-top:10px;">
<!--예약상태/-->
<? if($is_admin) {?>
<tr style="background:#f5f5f5; border-top:1px solid #222; border-bottom:1px solid #222;">
<td class="head">예약상태</td>
<td style="padding:20px 0 !important; ">
<select name="wr_8">
<option value="" selected>선택</option>
<option value="미승인" <?=($write['wr_8'] == "미승인")?'selected':'';?>>미승인</option>
<option value="승인" <?=($write['wr_8'] == "승인")?'selected':'';?>>승인</option>
</select>
<br><br>
관리자 메모1 : <input class="input2" name="wr_13" type="text" value="<?=$write['wr_13']?>">
<br>
관리자 메모2 : <input class="input2" name="wr_14" type="text" value="<?=$write['wr_14']?>">
</td>
</tr>
<? } ?>
<!--/예약상태-->
<!--사용장소/-->
<?php if ($is_category) { ?>
<tr>
<td class="head"><div style="position:absolute; top:15px; left:0px; color:#cc0000">*</div>사용희망 장소</td>
<td>
<select class="required" id="ca_name" name="ca_name" required>
<option value="">선택하세요</option>
<?php echo $category_option ?>
</select>
</td>
</tr>
<?php } ?>
<!--/사용장소-->
<!--기타사항/-->
<?
$wr_19_arr = array( // 기타정보 설정
"1" => "냉난방",
"2" => "빔프로젝트");
?>
<tr>
<td class="head">기타 정보 설정</td>
<td>
<?
$wr_19 = explode("|", $write['wr_19']);
foreach($wr_19_arr as $key => $val) {
$chk = in_array($key, $wr_19) ? " checked" : "";
echo "<label><input type='checkbox' name='wr_19[]' value='".$key."'".$chk."> ".$val."</label> ";
}
?>
(마이크 : <input name="wr_12" type="text" class="input" id="wr_12" value="<?=$write['wr_12']?>" >개)
(기타 : <input name="wr_21" type="text" class="input" id="wr_21" value="<?=$write['wr_21']?>" >)
<td>
</tr>
<!--/기타사항-->
<!--계약조건/-->
<?// if($is_guest) { ?>
<tr>
<td class="head">계약조건</td>
<td>
<div class="info">
<div class="scr">
약관
</div>
<p align="left" style="color:#f30;">
위 이용안내 사항을 읽었고 동의합니다. <input type="checkbox" name="chk" checked>
</p>
</div>
</td>
</tr>
<?// } ?>
<!--/계약조건-->
<!--교육명/-->
<tr>
<td class="head">교육명</td>
<td>
<input name="wr_3" type="text" class="input" id="wr_3" value="<?=$write['wr_3']?>" >
</td>
</tr>
<!--/교육명-->
<!--회사명/-->
<tr>
<td class="head">회사명</td>
<td>
<input name="wr_4" type="text" class="input" id="wr_4" value="<?=$write['wr_4']?>" >
</td>
</tr>
<!--/회사명-->
<!--대표자명-->
<tr>
<td class="head"><div style="position:absolute; top:15px; left:0px; color:#cc0000">*</div><font color="#333">대표자명</font></td>
<td>
<input class="input" name="wr_name" type="text" id="name" value="<?=$write['wr_name']?>" required>
</td>
</tr>
<!--/대표자명-->
<!--담당자/-->
<tr>
<td class="head">담당자명</td>
<td>
<input name="wr_9" type="text" class="input" id="wr_9" value="<?=$write['wr_9']?>" >
</td>
</tr>
<!--/담당자-->
<!--사업자등록번호(필드3개쪼개기)/-->
<?
$wr_16 = explode("-",$write['wr_16']);
$bizcode1 = $wr_16[0];
$bizcode2 = $wr_16[1];
$bizcode3 = $wr_16[2];
?>
<tr>
<td class="head"><font color="#333">사업자등록번호</font></td>
<td>
<input name="bizcode1" class="input_tel" type="text" maxlength="3" size="4" id="bizcode1" value="<?=$bizcode1?>"> -
<input name="bizcode2" class="input_tel" type="text" maxlength="2" size="4" id="bizcode2" value="<?=$bizcode2?>"> -
<input name="bizcode3" class="input_tel" type="text" maxlength="5" size="4" id="bizcode3" value="<?=$bizcode3?>">
</td>
</tr>
<!--/사업자등록번호-->
<!--주소/-->
<tr>
<td class="head">주소</td>
<td>
<label for="ex_zip" class="sound_only">우편번호</label>
<input type="text" name="ex_zip" value="<?php echo $ex_zip; ?>" id="ex_zip" class="frm_input" size="6" maxlength="6">
<button type="button" class="btn_frmline" onclick="win_zip('fwrite', 'ex_zip', 'ex_addr1', 'ex_addr2', 'ex_addr3', 'ex_jibeon');">주소 검색</button><br>
<input type="text" name="ex_addr1" value="<?php echo $ex_addr1; ?>" id="ex_addr1" class="frm_input frm_address" size="50">
<label for="ex_addr1">기본주소</label><br>
<input type="text" name="ex_addr2" value="<?php echo $ex_addr2; ?>" id="ex_addr2" class="frm_input frm_address" size="50">
<label for="ex_addr2">상세주소</label>
<br>
<input type="text" name="ex_addr3" value="<?php echo $ex_addr3; ?>" id="ex_addr3" class="frm_input frm_address" size="50" readonly="readonly">
<label for="ex_addr3">참고항목</label>
<input type="hidden" name="ex_jibeon" value="<?php echo $ex_jibeon; ?>">
</td>
</tr>
<!--/주소-->
<!--연락처/-->
<?
$wr_6 = explode("-",$write['wr_6']);
$tel1 = $wr_6[0];
$tel2 = $wr_6[1];
$tel3 = $wr_6[2];
?>
<tr>
<td class="head"><div style="position:absolute; top:15px; left:0px; color:#cc0000">*</div><font color="#333">연락처</font></td>
<td>
<select name="tel1" id="tel1" class="input_tel">
<option value="" >선택</option>
<option value="010" <?=($tel1 == "010")?'selected':'';?>>010</option>
<option value="011" <?=($tel1 == "011")?'selected':'';?>>011</option>
<option value="016" <?=($tel1 == "016")?'selected':'';?>>016</option>
<option value="017" <?=($tel1 == "017")?'selected':'';?>>017</option>
<option value="018" <?=($tel1 == "018")?'selected':'';?>>018</option>
<option value="019" <?=($tel1 == "019")?'selected':'';?>>019</option>
</select> -
<input name="tel2" class="input_tel" type="text" maxlength="4" size="4" id="tel2" value="<?=$tel2?>"> -
<input name="tel3" class="input_tel" type="text" maxlength="4" size="4" id="tel3" value="<?=$tel3?>">
</td>
</tr>
<!--/연락처-->
<!--이메일/-->
<?
$wr_7 = explode("@",$write['wr_7']);
$email1 = $wr_7[0];
$email2 = $wr_7[1];
?>
<script>
$(document).ready(function() {
$('#selectEmail').change(function() {
if($(this).val()=='1') {
$("#email2").val('');
} else
$("#email2").val($(this).val());
});
});
</script>
<tr>
<td class="head"><div style="position:absolute; top:15px; left:0px; color:#cc0000">*</div>이메일</td>
<td>
<input name="email1" class="input_email" type="text" id="email1" value="<?=$email1?>" required> @
<input name="email2" class="input_email" type="text" id="email2" value="<?=$email2?>" required>
<select name="selectEmail" id="selectEmail" class="">
<option value="">직접입력</option>
<option value="naver.com" <?php echo ($write['email2'] == "naver.com") ? "selected" : "";?>>naver.com</option>
<option value="hanmail.net" <?php echo ($write['email2'] == "hanmail.net") ? "selected" : "";?>>hanmail.net</option>
<option value="nate.com" <?php echo ($write['email2'] == "nate.com") ? "selected" : "";?>>nate.com</option>
<option value="gmail.com" <?php echo ($write['email2'] == "gmail.com") ? "selected" : "";?>>gmail.com</option>
<option value="lycos.co.kr" <?php echo ($write['email2'] == "lycos.co.kr") ? "selected" : "";?>>lycos.co.kr</option>
<option value="yahoo.co.kr" <?php echo ($write['email2'] == "yahoo.co.kr") ? "selected" : "";?>>yahoo.co.kr</option>
<option value="yahoo.com" <?php echo ($write['email2'] == "yahoo.com") ? "selected" : "";?>>yahoo.com</option>
<option value="empal.com" <?php echo ($write['email2'] == "empal.com") ? "selected" : "";?>>empal.com</option>
<option value="dreamwiz.com" <?php echo ($write['email2'] == "dreamwiz.com") ? "selected" : "";?>>dreamwiz.com</option>
</select>
</td>
</tr>
<!--/이메일-->
<!--사용기간/-->
<tr>
<td class="head"><div style="position:absolute; top:15px; left:0px; color:#cc0000">*</div><font color="#333">사용시작</font></td>
<td>
<input type="text" class="input3" name="wr_1" size="16" maxlength="16" id="wr_1" readonly value="<? if ($w == '') { ?><?=$write['wr_1']?><? } else { ?><?php echo date('Y-m-d', strtotime($write['wr_1'])) ?><? } ?>" required>
<select name="wr_10" id="wr_10" >
<option value="">선택</option>
<option value="09" <?php echo ($write['wr_10'] == "09") ? "selected" : "";?>>09</option>
<option value="10" <?php echo ($write['wr_10'] == "10") ? "selected" : "";?>>10</option>
<option value="11" <?php echo ($write['wr_10'] == "11") ? "selected" : "";?>>11</option>
<option value="12" <?php echo ($write['wr_10'] == "12") ? "selected" : "";?>>12</option>
<option value="13" <?php echo ($write['wr_10'] == "13") ? "selected" : "";?>>13</option>
<option value="14" <?php echo ($write['wr_10'] == "14") ? "selected" : "";?>>14</option>
<option value="15" <?php echo ($write['wr_10'] == "15") ? "selected" : "";?>>15</option>
<option value="16" <?php echo ($write['wr_10'] == "16") ? "selected" : "";?>>16</option>
<option value="17" <?php echo ($write['wr_10'] == "17") ? "selected" : "";?>>17</option>
<option value="18" <?php echo ($write['wr_10'] == "18") ? "selected" : "";?>>18</option>
</select>
</td>
</tr>
<tr>
<td class="head"><div style="position:absolute; top:15px; left:0px; color:#cc0000">*</div><font color="#333">사용종료</font></td>
<td>
<input type="text" class="input3" name="wr_2" size="16" maxlength="16" id="wr_2" readonly value="<? if ($w == '') { ?><?=$write['wr_2']?><? } else { ?><?php echo date('Y-m-d', strtotime($write['wr_2'])) ?><? } ?>" required>
<select name="wr_15" id="wr_15" >
<option value="">선택</option>
<option value="09" <?php echo ($write['wr_15'] == "09") ? "selected" : "";?>>09</option>
<option value="10" <?php echo ($write['wr_15'] == "10") ? "selected" : "";?>>10</option>
<option value="11" <?php echo ($write['wr_15'] == "11") ? "selected" : "";?>>11</option>
<option value="12" <?php echo ($write['wr_15'] == "12") ? "selected" : "";?>>12</option>
<option value="13" <?php echo ($write['wr_15'] == "13") ? "selected" : "";?>>13</option>
<option value="14" <?php echo ($write['wr_15'] == "14") ? "selected" : "";?>>14</option>
<option value="15" <?php echo ($write['wr_15'] == "15") ? "selected" : "";?>>15</option>
<option value="16" <?php echo ($write['wr_15'] == "16") ? "selected" : "";?>>16</option>
<option value="17" <?php echo ($write['wr_15'] == "17") ? "selected" : "";?>>17</option>
<option value="18" <?php echo ($write['wr_15'] == "18") ? "selected" : "";?>>18</option>
</select>
</td>
</tr>
<!--/사용기간-->
<!--사용목적/-->
<tr>
<td class="head"><font color="#333">사용목적</font></td>
<td>
<textarea name="wr_5" class="input_text" rows="6" cols="20" id="wr_5" onkeyup="TextBoxInputLengthCheck(100,'wr_5','textlimit');"><?=$write['wr_5']?></textarea>
<div style="font-size:11px; color:#888888; padding-top:4px;"><span id="textlimit">0</span>/100 bytes (최대 한글 100자, 영문 100자)</div>
</td>
</tr>
<!--/사용목적-->
</table>
<div class="btn">
<? if($w == 'u') { ?>
<input type="submit" value="수정완료" id="btn_submit" accesskey="s" class="btn_submit">
<a href="./board.php?bo_table=<?php echo $bo_table ?>" class="btn_cancel">취소</a>
<? } else { ?>
<input type="submit" value="예약문의" id="btn_submit" accesskey="s" class="btn_submit">
<? if($is_admin) {?>
<a href="./board.php?bo_table=<?php echo $bo_table ?>" class="btn_cancel">취소</a>
<? } ?>
<? } ?>
</div>
</form>
</div>
<script>
<?php if($write_min || $write_max) { ?>
// 글자수 제한
var char_min = parseInt(<?php echo $write_min; ?>); // 최소
var char_max = parseInt(<?php echo $write_max; ?>); // 최대
check_byte("wr_content", "char_count");
$(function() {
$("#wr_content").on("keyup", function() {
check_byte("wr_content", "char_count");
});
});
<?php } ?>
function html_auto_br(obj)
{
if (obj.checked) {
result = confirm("자동 줄바꿈을 하시겠습니까?\n\n자동 줄바꿈은 게시물 내용중 줄바뀐 곳을<br>태그로 변환하는 기능입니다.");
if (result)
obj.value = "html2";
else
obj.value = "html1";
}
else
obj.value = "";
}
function fwrite_submit(f)
{
if (!f.chk.checked) {
alert("이용안내 사항에 체크하셔야 합니다.");
f.chk.focus();
return false;
}
if(!f.room.value)
{
alert("'룸선택' 항목은 필수 선택 사항입니다.");
$("#room").focus();
return false;
}
if(!f.wr_1.value)
{
alert("'입실날짜' 항목은 필수 입력 사항입니다.");
$("#wr_1").focus();
return false;
}
if(!f.wr_2.value)
{
alert("'퇴실날짜' 항목은 필수 입력 사항입니다.");
$("#wr_2").focus();
return false;
}
if(!f.name.value)
{
alert("'예약자명' 항목은 필수 입력 사항입니다.");
$("#name").focus();
return false;
}
if(!$("#tel1").val() || !$("#tel2").val() || !$("#tel3").val())
{
alert("'연락처' 항목은 필수 입력 사항입니다.");
$("#tel1").focus();
return false;
}
if(!$("#email1").val() || !$("#email2").val())
{
alert("'이메일' 항목은 필수 입력 사항입니다.");
$("#email1").focus();
return false;
}
if(!f.wr_3.value)
{
alert("'투숙인원(7세이상)' 항목은 필수 입력 사항입니다.");
$("#wr_3").focus();
return false;
}
if(!f.wr_4.value)
{
alert("'투숙인원(7세미만)' 항목은 필수 입력 사항입니다.");
$("#wr_4").focus();
return false;
}
<?php echo $editor_js; // 에디터 사용시 자바스크립트에서 내용을 폼필드로 넣어주며 내용이 입력되었는지 검사함 ?>
var subject = "";
var content = "";
$.ajax({
url: g5_bbs_url+"/ajax.filter.php",
type: "POST",
data: {
"subject": f.wr_subject.value,
"content": f.wr_content.value
},
dataType: "json",
async: false,
cache: false,
success: function(data, textStatus) {
subject = data.subject;
content = data.content;
}
});
if (subject) {
alert("제목에 금지단어('"+subject+"')가 포함되어있습니다");
f.wr_subject.focus();
return false;
}
if (content) {
alert("내용에 금지단어('"+content+"')가 포함되어있습니다");
if (typeof(ed_wr_content) != "undefined")
ed_wr_content.returnFalse();
else
f.wr_content.focus();
return false;
}
if (document.getElementById("char_count")) {
if (char_min > 0 || char_max > 0) {
var cnt = parseInt(check_byte("wr_content", "char_count"));
if (char_min > 0 && char_min > cnt) {
alert("내용은 "+char_min+"글자 이상 쓰셔야 합니다.");
return false;
}
else if (char_max > 0 && char_max < cnt) {
alert("내용은 "+char_max+"글자 이하로 쓰셔야 합니다.");
return false;
}
}
}
<?php echo $captcha_js; // 캡챠 사용시 자바스크립트에서 입력된 캡챠를 검사함 ?>
document.getElementById("btn_submit").disabled = "disabled";
return true;
}
</script>
</section>
<!-- } 게시물 작성/수정 끝 -->
write_update.skin.php
[code]
//기타 wr_19
$wr_19 = implode('|', $_POST['wr_19']);
$sql = " update $write_table set wr_19 = '$wr_19' where wr_id = '$wr_id' ";
sql_query($sql);
//사업자등록번호(필드3개쪼개기)
$wr_16 = "$bizcode1-$bizcode2-$bizcode3";
$sql2 = " update $write_table set wr_16 = '$wr_16' where wr_id = '$wr_id' ";
sql_query($sql2);
//전화번호(필드3개쪼개기)
$wr_6 = "$tel1-$tel2-$tel3";
$sql3 = " update $write_table set wr_6 = '$wr_6' where wr_id = '$wr_id' ";
sql_query($sql3);
// 주소 wr_18
$wr_18 = "$ex_zip|$ex_addr1|$ex_addr2|$ex_addr3|$ex_jibeon";
$sql4 = " update {$write_table} set wr_18 = '{$wr_18}' where wr_id = '{$wr_id}' ";
sql_query($sql4);
//
$wr_7 = "$email1@$email2";
$sql5 = " update $write_table set wr_7 = '$wr_7' where wr_id = '$wr_id' ";
sql_query($sql5);
//
$wr_1 = " update $write_table set wr_1 = replace(wr_1, '-', '') where wr_id = '$wr_id' ";
sql_query($wr_1);
$wr_2 = " update $write_tabl
답변 4
wr_12, wr_21, wr_15 값을 저장하는 update 구문은 어디에 있나요?
아래와 같은 코드가 잇어야 저장이 될테니까요
sql_query("update $write_table set wr_12='$wr_12', ~~~~");
그리고 $wr_19, $wr_16, $wr_6 등의 값을 합쳐서 각각 저장 쿼리를 실행하는데 좋지않습니다
합치는 구분문 위쪽에 모아놓고 쿼리는 아래처럼 한번만 하도록 만드세요
sql_query("update $write_table set wr_1='$wr_1', wr_2='$wr_2', wr_7='$wr_7', ~~~ where wr_id='$wr_id'");
write_update.skin.php 하단부분에, 이렇게 넣어보면...
echo "wr_12값 : ".$wr_12."<br>";
echo "wr_15값 : ".$wr_15."<br>";
echo "wr_21값 : ".$wr_21;
값이 넘어오는지 알 수 있겠지요.
그런데.. wr_15 값은 스크립트로 계산을 하는군요.(f.wr_15)
스크립트 값을 php로 보내는 방법은 아시겠지요.^^
write_update.skin.php 파일 제일 상단에서
print_r2($_POST);
exit;
이렇게 입력해 보세요.
값이 정상적으로 나오는지부터 체크해 보셔야 할 것 같네요.
그누보드는 게시판에 추가필드로 wr_1 부터 wr_10 까지 10개를 기본 생성 제공합니다.
본문에 첨부한 내용은 wr_11 ~ wr_21 까지 추가 필드를 사용 하는것으로 되어있습니다.
그렇다면 게시판에 미리 wr_11 ~ wr_21 까지 디비에 필드가 추가된 상태이어야 합니다.
먼저 필드 추가가 되었는지 확인을 해주세요.
추가필드 관련팁을 링크합니다.