php파일에서 댓글쓰기 정보
php파일에서 댓글쓰기본문
필요해서 급하게 만들어서 소스가 개판일수도있습니다.
extend 폴더에 test.php 만드시고 업로드 하세요 아래소스~
한가지 말씀드리면 extend 는 인크루드 안하셔도 작동합니다.
<?php
function comment($bo_table_f,$wr_id_f,$mb_id_f,$mb_pw_f,$mb_nick_f,$content){
global $g4;
$bo_tbe = 'g4_write_'.$bo_table_f;
$row = "select wr_id ,wr_num,wr_parent,wr_comment from $bo_tbe where wr_id = $wr_id_f and wr_is_comment = 0";
$fetch = sql_fetch($row);
$sql = "insert into $bo_tbe
set wr_num = '".$fetch['wr_num']."',
wr_is_comment = 1,
wr_content = '$content',
wr_link1_hit = 0,
wr_link2_hit = 0,
wr_hit = 0,
wr_good = 0,
wr_nogood = 0,
mb_id = '$mb_id_f',
wr_password = '".sql_password($mb_pw_f)."',
wr_name = '$mb_nick_f',
wr_email = '$wr_email',
wr_datetime = '$g4[time_ymdhis]',
wr_last = '$g4[time_ymdhis]',
wr_ip = '$_SERVER[REMOTE_ADDR]' ";
sql_query($sql);
$wr_id = mysql_insert_id();
sql_query(" update $bo_tbe set wr_parent = '$fetch[wr_parent]' where wr_id = '$wr_id' ");
sql_query(" update $bo_tbe set wr_comment = $fetch[wr_comment] + 1 where wr_id = '$fetch[wr_id]' ");
}
?>
사용법
echo comment('게시판',wr_id번호,'아이디','패스워드','닉네임','코멘트내용');
응용하시면
다른사이트 댓글 파싱해와서 자동으로 올리거나 할수도있습니다.
extend 폴더에 test.php 만드시고 업로드 하세요 아래소스~
한가지 말씀드리면 extend 는 인크루드 안하셔도 작동합니다.
<?php
function comment($bo_table_f,$wr_id_f,$mb_id_f,$mb_pw_f,$mb_nick_f,$content){
global $g4;
$bo_tbe = 'g4_write_'.$bo_table_f;
$row = "select wr_id ,wr_num,wr_parent,wr_comment from $bo_tbe where wr_id = $wr_id_f and wr_is_comment = 0";
$fetch = sql_fetch($row);
$sql = "insert into $bo_tbe
set wr_num = '".$fetch['wr_num']."',
wr_is_comment = 1,
wr_content = '$content',
wr_link1_hit = 0,
wr_link2_hit = 0,
wr_hit = 0,
wr_good = 0,
wr_nogood = 0,
mb_id = '$mb_id_f',
wr_password = '".sql_password($mb_pw_f)."',
wr_name = '$mb_nick_f',
wr_email = '$wr_email',
wr_datetime = '$g4[time_ymdhis]',
wr_last = '$g4[time_ymdhis]',
wr_ip = '$_SERVER[REMOTE_ADDR]' ";
sql_query($sql);
$wr_id = mysql_insert_id();
sql_query(" update $bo_tbe set wr_parent = '$fetch[wr_parent]' where wr_id = '$wr_id' ");
sql_query(" update $bo_tbe set wr_comment = $fetch[wr_comment] + 1 where wr_id = '$fetch[wr_id]' ");
}
?>
사용법
echo comment('게시판',wr_id번호,'아이디','패스워드','닉네임','코멘트내용');
응용하시면
다른사이트 댓글 파싱해와서 자동으로 올리거나 할수도있습니다.
추천
4
4
댓글 1개
오 때에따라 좋은 팁이네요~^^