메인에서 글쓰기 질문입니다..
본문
<form name="fwrite" id="fwrite" action="/bbs/write_update.php"
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="">
<input type="hidden" name="bo_table" value="0101">
<?php
$_SESSION['myRand']="";
$_SESSION['checksum']="";
$_SESSION['SESSIONNAME']="";
$_SESSION['SESE_value']="";
$_SESSION['myRand']=md5(time().date("Y-m-d-H-i-s").rand(0,9999));
$_SESSION['checksum']=sha1("sangmin".$_SESSION['myRand']."checksum");
$_SESSION['SESSIONNAME'] = md5(mt_rand(0,999));
$_SESSION['SESE_value'] = sha1(md5(mt_rand(0,999)."12345Session"));
$_SESSION['key'] = sha1("MySESSION".mt_rand(0,9999)."So_Great".mt_rand(0,9999)."baechu".date("YmdHis"));
?>
<input type="hidden" name="chk_token" value="<?php echo $_SESSION['myRand']; ?>">
<input type="hidden" name="chk_checksum" value="<?php echo $_SESSION['checksum']; ?>">
<input type="hidden" name="<?php echo $_SESSION['SESSIONNAME'] ?>" value="<?php echo $_SESSION['SESE_value']; ?>">
<input type="hidden" name="session_key" value="<?php echo md5($_SESSION['key']); ?>">
<input type="hidden" name="session_pin"
value="<?php echo md5(base64_encode($_SERVER['REMOTE_ADDR']."and".$_COOKIE['PHPSESSID'].$_SESSION['key'])); ?>">
<table class="ui form definition table">
<tbody>
<tr style="display:none">
<td><input type="text" name="wr_subject" value="관심고객 신청인원 입니다." id="wr_subject" required placeholder="제목"></td>
</tr>
<tr>
<td>성명</td>
<td><input type="text" name="wr_name" value="" id="wr_name" required placeholder="이름" ></td>
</tr>
<tr>
<td>연령대</td>
<td>
<div class="radio-wrap"><input type="radio" name="wr_1" value="20대" id="age20" checked> <label for="age20">20대</label></div>
<div class="radio-wrap"><input type="radio" name="wr_1" value="30대" id="age30" <?php echo ($write['wr_1'] == "30대") ? " checked" : "";?>> <label for="age30">30대</label></div>
<div class="radio-wrap"><input type="radio" name="wr_1" value="40대" id="age40" <?php echo ($write['wr_1'] == "40대") ? " checked" : "";?>> <label for="age40">40대</label></div>
<div class="radio-wrap"><input type="radio" name="wr_1" value="50대" id="age50" <?php echo ($write['wr_1'] == "50대") ? " checked" : "";?>> <label for="age50">50대</label></div>
<div class="radio-wrap"><input type="radio" name="wr_1" value="60대" id="age60" <?php echo ($write['wr_1'] == "60대") ? " checked" : "";?>> <label for="age60">60대</label></div>
<div class="radio-wrap"><input type="radio" name="wr_1" value="70대" id="age70" <?php echo ($write['wr_1'] == "70대") ? " checked" : "";?>> <label for="age70">70대이상</label></div>
</td>
</tr>
<tr>
<td>성별</td>
<td>
<div class="radio-wrap"><input type="radio" name="wr_2" value="남성" id="sex1" checked> <label for="sex1">남성</label> </div>
<div class="radio-wrap"><input type="radio" name="wr_2" value="여성" id="sex2"<?php echo ($write['wr_2'] == "여성") ? " checked" : "";?>> <label for="sex2">여성</label> </div>
</td>
</tr>
<tr>
<td>휴대전화</td>
<td><input type="text" name="wr_3" value="" id="wr_3" required placeholder="휴대전화" ></td>
</tr>
<tr>
<td>내용</td>
<td>
<textarea id="wr_content" name="wr_content" rows="4" required style="height:80px;" placeholder="내용"></textarea>
</td>
</tr>
</tbody>
</table>
<button name="submit" class="ui button" style="color:#fff;background-color: #002042;">관심고객등록하기</button>
</form>
<script language="javascript">
<?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 fwrite_submit(f) {
<?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;
}
}
}
document.getElementById("btn_submit").disabled = "disabled";
return true;
}
</script>
메인에서 글쓰기로 글작성은 되는데
해당 게시판에가서 보면 wr_datetime 에 값이 안들어가네요..ㅠㅠ 계속 씨름해봤는데 원인을 못찾겠어서 고수님들께 여쭙니다..
!-->답변 2
write_update.php 여기에 insert 에
wr_datetime = '".G5_TIME_YMDHIS."', 이부분이 제대로 들어가있으실까요?
basic 에서 write.update.skin 에서 구문 있던걸 지우니 되네요 ㅎㅎ
답변을 작성하시기 전에 로그인 해주세요.