다시 div $memo 값을 intput에 출력하여 전송하는 방법 질문입니다. 정보
다시 div $memo 값을 intput에 출력하여 전송하는 방법 질문입니다.
본문
<?
include_once("./_common.php");
$SS_NAME = "SS_NAME_TALK";
// 세션 생성
if (empty($_SESSION[$SS_NAME])) {
set_session($SS_NAME, true);
}
// 12시간
$talk_time = date("Y-m-d H:i:s", $g4['server_time'] - (3));
// 삭제
sql_query(" delete from $p4[talk_table] where datetime <= '$talk_time' ");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=<?=$g4['charset']?>">
<title>한줄 토크</title>
</head>
</script>
<script type="text/javascript" src="<?=$g4['path']?>/js/jquery-1.4.2.min.js"></script>
<body>
<style type="text/css">
/* default */
* {margin:0; padding:0;}
html, body {width:100%; height:100%;}
body {background-color:#ffffff;}
body, input, button {font-size:12px; line-height:1.5em; font-family:"돋움",Dotum,Helvetica,AppleGothic,Sans-serif; color:#333333;}
li {list-style:none;}
a {color:#ffffff; text-decoration:none;}
a:hover {color:#ffffff; text-decoration:underline;}
/*table {margin:0 auto;}*/
p{ margin-top:3px; margin-bottom:3px;}
body .checkbox {width:13px; height:13px; position:relative; overflow:hidden; left:0; top:0;}
body select {line-height:14px; font-size:12px; color:#333333; font-family:dotum,돋움; border:1px solid #dddddd;}
body select option {padding:0 3px 0 3px; line-height:14px; font-size:12px; color:#333333; font-family:dotum,돋움;}
.auto {margin:0 auto;}
.none {font-size:1px; line-height:1px;}
.clr {clear:both; font-size:0px;}
#contents
{
clear:both;
width:800px;
margin:0px auto 10px auto;
}
/* talk_list */
#talk_write {padding:0px 0 5px 0;}
#talk_write .t1 {line-height:14px; font-size:12px; color:#333333; font-family:dotum,돋움;}
#talk_write .t2 {line-height:14px; font-size:11px; color:#333333; font-family:dotum,돋움; letter-spacing:-1px;}
#talk_write .out {padding:5px; background-color:#333333;}
#talk_write .in {height:25px; background-color:#ffffff;}
#talk_write .input {width:350px; height:16px; border:0px; padding:5px 5px 0 5px;}
#talk_write .input {font-weight:bold; line-height:16px; font-size:14px; color:#333333; font-family:dotum,돋움;}
#talk_write .input2 {width:40px; height:20px; border:1px solid #c9c9c9; padding:0px 3px 0px 3px;}
#talk_write .input2 {line-height:20px; font-size:12px; color:#414141; font-family:gulim,굴림;}
#talk_bg_list div {width:10px; height:20px; cursor:pointer;}
/* talk_list */
#talk_list
{
clear:both;
width:100%;
height:100%;
background-color:#F6F6F6;
}
#talk_list li
{
clear:both;
padding:0px 30px 20px 30px;
}
#talk_list dl
{
clear:both;
padding-top:20px;
}
#talk_list dl dt, #contents dl dd
{
float:left;
}
#talk_list dl dt span
{
clear:both;
display:block;
width:95px;
}
#talk_list dl dt .thumb
{
border:2px solid #ffffff;
}
#talk_list dl dt .name
{
margin-top:5px;
}
#talk_list dl dt .name
{
font-weight:bold; color:#000000;
}
#talk_list dl dd
{
margin-left:25px;
max-width:790px;
}
#talk_list dl dd div
{
padding:15px 20px;
border-radius:13px;
border:4px solid #ffffff;
-moz-border-radius:13px;
-webkit-border-radius:13px;
}
#talk_list dl dd div.gray, #talk_write div.gray
{
background:transparent url('<?=$g4['path']?>/image/gray.png') repeat-x left center;
}
#talk_list dl dd div.blue, #talk_write div.blue
{
background:transparent url('<?=$g4['path']?>/image/blue.png') repeat-x left center;
}
#talk_list dl dd div.red, #talk_write div.red
{
background:transparent url('<?=$g4['path']?>/image/red.png') repeat-x left center;
}
#talk_list dl dd div.pink, #talk_write div.pink
{
background:transparent url('<?=$g4['path']?>/image/pink.png') repeat-x left center;
}
#talk_list dl dd div.green, #talk_write div.green
{
background:transparent url('<?=$g4['path']?>/image/green.png') repeat-x left center;
}
#talk_list dl dd div.orange, #talk_write div.orange
{
background:transparent url('<?=$g4['path']?>/image/orange.png') repeat-x left center;
}
#talk_list dl dd div p
{
line-height:21px; font-size:15px; color:#ffffff; font-family:gulim,굴림;
letter-spacing:3px;
}
</style>
<script type="text/javascript">
function elementFocus(id)
{
document.formTalk.bg[id].checked = true;
}
</script>
<div id="contents" class="auto">
<div id="talk_update" style="display:none;"></div>
<div id="talk_write">
<?
$msg = "메세지를 입력하세요.";
?>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">
<table border="0" cellspacing="0" cellpadding="0" style="margin-top:10px;">
<tr>
<td><div class="box"><div class="out"><div class="in"><input type="text" id="memo" name="memo" class="input" value="<?=$msg?>" onkeypress="if (event.keyCode == '13') { submitTalk(); }" onmouseover="checkTrue();" /></div></div></div></td>
<td width="5"></td>
<td><div style="background-color:#2e9700;"><a href="#" onclick="submitTalk(); return false;"><img src="<?=$g4['path']?>/image/search.gif" width="44" height="35" border="0"></a></div></td>
</tr>
</table>
</td>
<td width="30"></td>
<td valign="top">
<?
// 키 생성
$robot_mkey1 = substr($g4['time_ymdhis'],17,2);
$robot_mkey2 = substr($member['mb_id'],0,1);
$robot_mkey3 = $_SERVER[REMOTE_ADDR];
$robot_mkey = substr(md5($robot_mkey1.$robot_mkey2.$robot_mkey3),0,10);
?>
<form method="post" name="formTalk">
<input type="hidden" name="robot_mkey1" value="<?=$g4['time_ymdhis']?>" />
<input type="hidden" name="robot_mkey2" value="<?=$member['mb_id']?>" />
<input type="hidden" name="robot_mkey3" value="<?=$_SERVER[REMOTE_ADDR]?>" />
<input type="hidden" name="robot_mkey" value="<?=$robot_mkey?>" />
<table border="0" cellspacing="0" cellpadding="0" style="margin-top:10px;">
<tr>
<td><span class="t1">색상</span></td>
<td width="5"></td>
<td><input type="text" id="color" name="color" value="ffffff" maxlength="6" readonly class="input2" /></td>
<td width="5"></td>
<td><div id="color_preview" style="width:18px; height:18px; border:1px solid #dddddd; background-color:#ffffff;"></div></td>
<td width="15"></td>
<td><span class="t1">굵게</span></td>
<td width="5"></td>
<td><input type="checkbox" id="bold" name="bold" value="1" class="checkbox" /></td>
<td width="50"></td>
<td>
<table id="talk_bg_list" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="radio" name="bg" value="gray" class="radio" checked /></td>
<td width="5"></td>
<td><div class="gray" onclick="elementFocus('0');"></div></td>
<td width="10"></td>
<td><input type="radio" name="bg" value="blue" class="radio" /></td>
<td width="5"></td>
<td><div class="blue" onclick="elementFocus('1');"></div></td>
<td width="10"></td>
<td><input type="radio" name="bg" value="red" class="radio" /></td>
<td width="5"></td>
<td><div class="red" onclick="elementFocus('2');"></div></td>
<td width="10"></td>
<td><input type="radio" name="bg" value="pink" class="radio" /></td>
<td width="5"></td>
<td><div class="pink" onclick="elementFocus('3');"></div></td>
<td width="10"></td>
<td><input type="radio" name="bg" value="green" class="radio" /></td>
<td width="5"></td>
<td><div class="green" onclick="elementFocus('4');"></div></td>
<td width="10"></td>
<td><input type="radio" name="bg" value="orange" class="radio" /></td>
<td width="5"></td>
<td><div class="orange" onclick="elementFocus('5');"></div></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</td>
</tr>
<tr><td height="1" colspan="3"></td></tr>
</table>
</div>
<script type="text/javascript">
document.getElementById("memo").focus();
function checkTrue()
{
if (document.getElementById("memo").value == '<?=$msg?>') {
document.getElementById("memo").value = "";
}
}
function submitTalk()
{
var memo = document.getElementById("memo").value;
if (memo == '' || memo == '<?=$msg?>') {
alert("메세지를 입력하세요.");
document.getElementById("memo").focus();
return false;
}
var f = document.formTalk;
// 배경
for (i=0; i<f.bg.length; i++) {
if (f.bg[i].checked == true) {
var tmp_bg = f.bg[i].value;
break;
}
}
// 볼드
if (f.bold.checked == true) {
var tmp_bold = "1";
} else {
var tmp_bold = "0";
}
// 초기화
document.getElementById("memo").value = "";
$.post("./talk_update.php", {"memo" : memo, "bg" : tmp_bg, "color" : f.color.value, "bold" : tmp_bold, "robot_mkey1" : f.robot_mkey1.value, "robot_mkey2" : f.robot_mkey2.value, "robot_mkey3" : f.robot_mkey3.value, "robot_mkey" : f.robot_mkey.value}, function(data) {
$("#talk_update").html(data);
});
}
</script>
<div id="talk_list">
<li>
<div id="talk_data"></div>
<div class="clr"></div>
</li>
</div>
</div>
<input type="hidden" id="talk_id" name="talk_id" value="" />
<input type="hidden" id="talk_count" name="talk_count" value="0" />
<script type="text/javascript">
document.getElementById("talk_id").value = "";
document.getElementById("talk_count").value = "0";
function talkLoading()
{
var talk_id = document.getElementById("talk_id").value;
var talk_count = parseInt(document.getElementById("talk_count").value);
if (talk_count >= '50') {
$.post("./talk_data.php", {"talk_id" : ""}, function(data) {
$("#talk_data").html(data);
});
} else {
$.post("./talk_data.php", {"talk_id" : talk_id}, function(data) {
$("#talk_data").html(data + document.getElementById("talk_data").innerHTML);
});
}
}
</script>
<script type="text/javascript">
setTimeout("talkLoading();", 100);
setInterval("talkLoading();", 5000);
</script>
</body>
</html>
플러그인에 한줄토그 중에.....
이값인데요
<input type="text" id="memo" name="memo" class="input" value="<?=$msg?>" onkeypress="if (event.keyCode == '13') { submitTalk(); }" onmouseover="checkTrue();" />
위곳 위치에
<div>갋을 함께 보내려고 하는 질문입니다
include_once("./_common.php");
$SS_NAME = "SS_NAME_TALK";
// 세션 생성
if (empty($_SESSION[$SS_NAME])) {
set_session($SS_NAME, true);
}
// 12시간
$talk_time = date("Y-m-d H:i:s", $g4['server_time'] - (3));
// 삭제
sql_query(" delete from $p4[talk_table] where datetime <= '$talk_time' ");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=<?=$g4['charset']?>">
<title>한줄 토크</title>
</head>
</script>
<script type="text/javascript" src="<?=$g4['path']?>/js/jquery-1.4.2.min.js"></script>
<body>
<style type="text/css">
/* default */
* {margin:0; padding:0;}
html, body {width:100%; height:100%;}
body {background-color:#ffffff;}
body, input, button {font-size:12px; line-height:1.5em; font-family:"돋움",Dotum,Helvetica,AppleGothic,Sans-serif; color:#333333;}
li {list-style:none;}
a {color:#ffffff; text-decoration:none;}
a:hover {color:#ffffff; text-decoration:underline;}
/*table {margin:0 auto;}*/
p{ margin-top:3px; margin-bottom:3px;}
body .checkbox {width:13px; height:13px; position:relative; overflow:hidden; left:0; top:0;}
body select {line-height:14px; font-size:12px; color:#333333; font-family:dotum,돋움; border:1px solid #dddddd;}
body select option {padding:0 3px 0 3px; line-height:14px; font-size:12px; color:#333333; font-family:dotum,돋움;}
.auto {margin:0 auto;}
.none {font-size:1px; line-height:1px;}
.clr {clear:both; font-size:0px;}
#contents
{
clear:both;
width:800px;
margin:0px auto 10px auto;
}
/* talk_list */
#talk_write {padding:0px 0 5px 0;}
#talk_write .t1 {line-height:14px; font-size:12px; color:#333333; font-family:dotum,돋움;}
#talk_write .t2 {line-height:14px; font-size:11px; color:#333333; font-family:dotum,돋움; letter-spacing:-1px;}
#talk_write .out {padding:5px; background-color:#333333;}
#talk_write .in {height:25px; background-color:#ffffff;}
#talk_write .input {width:350px; height:16px; border:0px; padding:5px 5px 0 5px;}
#talk_write .input {font-weight:bold; line-height:16px; font-size:14px; color:#333333; font-family:dotum,돋움;}
#talk_write .input2 {width:40px; height:20px; border:1px solid #c9c9c9; padding:0px 3px 0px 3px;}
#talk_write .input2 {line-height:20px; font-size:12px; color:#414141; font-family:gulim,굴림;}
#talk_bg_list div {width:10px; height:20px; cursor:pointer;}
/* talk_list */
#talk_list
{
clear:both;
width:100%;
height:100%;
background-color:#F6F6F6;
}
#talk_list li
{
clear:both;
padding:0px 30px 20px 30px;
}
#talk_list dl
{
clear:both;
padding-top:20px;
}
#talk_list dl dt, #contents dl dd
{
float:left;
}
#talk_list dl dt span
{
clear:both;
display:block;
width:95px;
}
#talk_list dl dt .thumb
{
border:2px solid #ffffff;
}
#talk_list dl dt .name
{
margin-top:5px;
}
#talk_list dl dt .name
{
font-weight:bold; color:#000000;
}
#talk_list dl dd
{
margin-left:25px;
max-width:790px;
}
#talk_list dl dd div
{
padding:15px 20px;
border-radius:13px;
border:4px solid #ffffff;
-moz-border-radius:13px;
-webkit-border-radius:13px;
}
#talk_list dl dd div.gray, #talk_write div.gray
{
background:transparent url('<?=$g4['path']?>/image/gray.png') repeat-x left center;
}
#talk_list dl dd div.blue, #talk_write div.blue
{
background:transparent url('<?=$g4['path']?>/image/blue.png') repeat-x left center;
}
#talk_list dl dd div.red, #talk_write div.red
{
background:transparent url('<?=$g4['path']?>/image/red.png') repeat-x left center;
}
#talk_list dl dd div.pink, #talk_write div.pink
{
background:transparent url('<?=$g4['path']?>/image/pink.png') repeat-x left center;
}
#talk_list dl dd div.green, #talk_write div.green
{
background:transparent url('<?=$g4['path']?>/image/green.png') repeat-x left center;
}
#talk_list dl dd div.orange, #talk_write div.orange
{
background:transparent url('<?=$g4['path']?>/image/orange.png') repeat-x left center;
}
#talk_list dl dd div p
{
line-height:21px; font-size:15px; color:#ffffff; font-family:gulim,굴림;
letter-spacing:3px;
}
</style>
<script type="text/javascript">
function elementFocus(id)
{
document.formTalk.bg[id].checked = true;
}
</script>
<div id="contents" class="auto">
<div id="talk_update" style="display:none;"></div>
<div id="talk_write">
<?
$msg = "메세지를 입력하세요.";
?>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">
<table border="0" cellspacing="0" cellpadding="0" style="margin-top:10px;">
<tr>
<td><div class="box"><div class="out"><div class="in"><input type="text" id="memo" name="memo" class="input" value="<?=$msg?>" onkeypress="if (event.keyCode == '13') { submitTalk(); }" onmouseover="checkTrue();" /></div></div></div></td>
<td width="5"></td>
<td><div style="background-color:#2e9700;"><a href="#" onclick="submitTalk(); return false;"><img src="<?=$g4['path']?>/image/search.gif" width="44" height="35" border="0"></a></div></td>
</tr>
</table>
</td>
<td width="30"></td>
<td valign="top">
<?
// 키 생성
$robot_mkey1 = substr($g4['time_ymdhis'],17,2);
$robot_mkey2 = substr($member['mb_id'],0,1);
$robot_mkey3 = $_SERVER[REMOTE_ADDR];
$robot_mkey = substr(md5($robot_mkey1.$robot_mkey2.$robot_mkey3),0,10);
?>
<form method="post" name="formTalk">
<input type="hidden" name="robot_mkey1" value="<?=$g4['time_ymdhis']?>" />
<input type="hidden" name="robot_mkey2" value="<?=$member['mb_id']?>" />
<input type="hidden" name="robot_mkey3" value="<?=$_SERVER[REMOTE_ADDR]?>" />
<input type="hidden" name="robot_mkey" value="<?=$robot_mkey?>" />
<table border="0" cellspacing="0" cellpadding="0" style="margin-top:10px;">
<tr>
<td><span class="t1">색상</span></td>
<td width="5"></td>
<td><input type="text" id="color" name="color" value="ffffff" maxlength="6" readonly class="input2" /></td>
<td width="5"></td>
<td><div id="color_preview" style="width:18px; height:18px; border:1px solid #dddddd; background-color:#ffffff;"></div></td>
<td width="15"></td>
<td><span class="t1">굵게</span></td>
<td width="5"></td>
<td><input type="checkbox" id="bold" name="bold" value="1" class="checkbox" /></td>
<td width="50"></td>
<td>
<table id="talk_bg_list" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="radio" name="bg" value="gray" class="radio" checked /></td>
<td width="5"></td>
<td><div class="gray" onclick="elementFocus('0');"></div></td>
<td width="10"></td>
<td><input type="radio" name="bg" value="blue" class="radio" /></td>
<td width="5"></td>
<td><div class="blue" onclick="elementFocus('1');"></div></td>
<td width="10"></td>
<td><input type="radio" name="bg" value="red" class="radio" /></td>
<td width="5"></td>
<td><div class="red" onclick="elementFocus('2');"></div></td>
<td width="10"></td>
<td><input type="radio" name="bg" value="pink" class="radio" /></td>
<td width="5"></td>
<td><div class="pink" onclick="elementFocus('3');"></div></td>
<td width="10"></td>
<td><input type="radio" name="bg" value="green" class="radio" /></td>
<td width="5"></td>
<td><div class="green" onclick="elementFocus('4');"></div></td>
<td width="10"></td>
<td><input type="radio" name="bg" value="orange" class="radio" /></td>
<td width="5"></td>
<td><div class="orange" onclick="elementFocus('5');"></div></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</td>
</tr>
<tr><td height="1" colspan="3"></td></tr>
</table>
</div>
<script type="text/javascript">
document.getElementById("memo").focus();
function checkTrue()
{
if (document.getElementById("memo").value == '<?=$msg?>') {
document.getElementById("memo").value = "";
}
}
function submitTalk()
{
var memo = document.getElementById("memo").value;
if (memo == '' || memo == '<?=$msg?>') {
alert("메세지를 입력하세요.");
document.getElementById("memo").focus();
return false;
}
var f = document.formTalk;
// 배경
for (i=0; i<f.bg.length; i++) {
if (f.bg[i].checked == true) {
var tmp_bg = f.bg[i].value;
break;
}
}
// 볼드
if (f.bold.checked == true) {
var tmp_bold = "1";
} else {
var tmp_bold = "0";
}
// 초기화
document.getElementById("memo").value = "";
$.post("./talk_update.php", {"memo" : memo, "bg" : tmp_bg, "color" : f.color.value, "bold" : tmp_bold, "robot_mkey1" : f.robot_mkey1.value, "robot_mkey2" : f.robot_mkey2.value, "robot_mkey3" : f.robot_mkey3.value, "robot_mkey" : f.robot_mkey.value}, function(data) {
$("#talk_update").html(data);
});
}
</script>
<div id="talk_list">
<li>
<div id="talk_data"></div>
<div class="clr"></div>
</li>
</div>
</div>
<input type="hidden" id="talk_id" name="talk_id" value="" />
<input type="hidden" id="talk_count" name="talk_count" value="0" />
<script type="text/javascript">
document.getElementById("talk_id").value = "";
document.getElementById("talk_count").value = "0";
function talkLoading()
{
var talk_id = document.getElementById("talk_id").value;
var talk_count = parseInt(document.getElementById("talk_count").value);
if (talk_count >= '50') {
$.post("./talk_data.php", {"talk_id" : ""}, function(data) {
$("#talk_data").html(data);
});
} else {
$.post("./talk_data.php", {"talk_id" : talk_id}, function(data) {
$("#talk_data").html(data + document.getElementById("talk_data").innerHTML);
});
}
}
</script>
<script type="text/javascript">
setTimeout("talkLoading();", 100);
setInterval("talkLoading();", 5000);
</script>
</body>
</html>
플러그인에 한줄토그 중에.....
이값인데요
<input type="text" id="memo" name="memo" class="input" value="<?=$msg?>" onkeypress="if (event.keyCode == '13') { submitTalk(); }" onmouseover="checkTrue();" />
위곳 위치에
<div>갋을 함께 보내려고 하는 질문입니다
댓글 전체

완성은 다되었는데
특정 불러오는 방식이라
setTimeout("talkLoading();", 100);
setInterval("talkLoading();", 5000);
5000 지나면 깜박이는 현상때문에 텍스&텍스트와 함께 디비에 업로드 하려 합니다.
설명하기도 그렇네요 ㅎㅎ
특정 불러오는 방식이라
setTimeout("talkLoading();", 100);
setInterval("talkLoading();", 5000);
5000 지나면 깜박이는 현상때문에 텍스&텍스트와 함께 디비에 업로드 하려 합니다.
설명하기도 그렇네요 ㅎㅎ