킴스큐 [킴스큐Rb] 게시글 날짜와 조회수 등 수정하기
페이지 정보
본문
1. / rb / modules / bbs / theme / _pc / 스킨 / view.php 11줄에서
<div class="xleft">
아래에 내용 추가
<?php if ($my['id'] == "관리자1" || $my['id'] == "관리자2") { ?>
<form name="hp_update" action="./hp_update.php" method="post">
<input type="hidden" name="uid" value="<?php echo $_GET['uid']; ?>">
<input type="hidden" name="bbsid" value="<?php echo $R['bbsid']; ?>">
<input type="hidden" name="m" value="<?php echo $_GET['m']; ?>">
<input type="hidden" name="p" value="<?php echo $_GET['p']; ?>">
작성일 <input type="text" name="d_regis" style="width:110px;" value="<?php echo $R['d_regis']; ?>">
조회 <input type="text" name="hit" style="width:30px;" value="<?php echo $R['hit']; ?>">
ID <input type="text" name="id" style="width:80px;" value="<?php echo $R['id']; ?>">
name <input type="text" name="name" style="width:100px;" value="<?php echo $R['name']; ?>">
nic <input type="text" name="nic" style="width:100px;" value="<?php echo $R['nic']; ?>">
<input type="submit" value=" 저장 "><br>
</form>
<?php } ?>
2. / rd / hp_update.php 파일 생성
<?php
@extract($_GET);
@extract($_POST);
@extract($_SERVER);
include "./_var/db.info.php";
$dbconn = mysql_connect($DB['host'],$DB['user'],$DB['pass']) or die("데이터베이스 연결에 실패하였습니다.");
mysql_select_db($DB['name'], $dbconn);
//echo $_POST[bo_table];
$query = " update ". $DB['head'] ."_bbs_data set id = '". $_POST['id'] ."', nic = '". $_POST['nic'] ."', name = '". $_POST['name'] ."', hit = '". $_POST['hit'] ."', d_regis = '". $_POST['d_regis'] ."' where uid = '". $_POST['uid'] ."' ";
$result = mysql_query($query);
//echo $query;
//exit;
if(!$result) die(mysql_error());
mysql_close($dbconn);
?>
<script>
location.href="./?m=<?php echo $_POST['m']; ?>&bid=<?php echo $_POST['bbsid']; ?>&p=<?php echo $_POST['p']; ?>&uid=<?php echo $_POST['uid']; ?>" ;
</script>
참고자료
http://www.kimsq.co.kr/?c=qna&p=2&uid=10991#.
http://jos39.tistory.com/193
<div class="xleft">
아래에 내용 추가
<?php if ($my['id'] == "관리자1" || $my['id'] == "관리자2") { ?>
<form name="hp_update" action="./hp_update.php" method="post">
<input type="hidden" name="uid" value="<?php echo $_GET['uid']; ?>">
<input type="hidden" name="bbsid" value="<?php echo $R['bbsid']; ?>">
<input type="hidden" name="m" value="<?php echo $_GET['m']; ?>">
<input type="hidden" name="p" value="<?php echo $_GET['p']; ?>">
작성일 <input type="text" name="d_regis" style="width:110px;" value="<?php echo $R['d_regis']; ?>">
조회 <input type="text" name="hit" style="width:30px;" value="<?php echo $R['hit']; ?>">
ID <input type="text" name="id" style="width:80px;" value="<?php echo $R['id']; ?>">
name <input type="text" name="name" style="width:100px;" value="<?php echo $R['name']; ?>">
nic <input type="text" name="nic" style="width:100px;" value="<?php echo $R['nic']; ?>">
<input type="submit" value=" 저장 "><br>
</form>
<?php } ?>
2. / rd / hp_update.php 파일 생성
<?php
@extract($_GET);
@extract($_POST);
@extract($_SERVER);
include "./_var/db.info.php";
$dbconn = mysql_connect($DB['host'],$DB['user'],$DB['pass']) or die("데이터베이스 연결에 실패하였습니다.");
mysql_select_db($DB['name'], $dbconn);
//echo $_POST[bo_table];
$query = " update ". $DB['head'] ."_bbs_data set id = '". $_POST['id'] ."', nic = '". $_POST['nic'] ."', name = '". $_POST['name'] ."', hit = '". $_POST['hit'] ."', d_regis = '". $_POST['d_regis'] ."' where uid = '". $_POST['uid'] ."' ";
$result = mysql_query($query);
//echo $query;
//exit;
if(!$result) die(mysql_error());
mysql_close($dbconn);
?>
<script>
location.href="./?m=<?php echo $_POST['m']; ?>&bid=<?php echo $_POST['bbsid']; ?>&p=<?php echo $_POST['p']; ?>&uid=<?php echo $_POST['uid']; ?>" ;
</script>
참고자료
http://www.kimsq.co.kr/?c=qna&p=2&uid=10991#.
http://jos39.tistory.com/193
댓글목록
등록된 댓글이 없습니다.