게시판 리스트 수정 삭제 버튼

게시판 리스트 수정 삭제 버튼

QA

게시판 리스트 수정 삭제 버튼

답변 2

본문

아래의 코드로 해서...   게시판 리스트 페이지에서는 정상적으로 수정 삭제 버튼이 작동 합니다.

하지만 지금 필요한건

인덱스 페이지에   new.php  파일을 불러 왓을경우

new 스킨의 목록 페이지에서  수정 삭제 버튼을 장착 하려고 하는데요

mew  스킨에서는 안먹히네요  

같은 리스트지만 변수 정의가 다른것인지...

new 스킨 목록에서 수정 삭제 버튼을 달려면 어찌 해야 할까요??

 


 <?php
         $update_href = $delete_href = '';
set_session('ss_delete_token', $token = uniqid(time()));
for ($i=0; $i<count($list); $i++) {
// 로그인중이고 자신의 글이라면 또는 관리자라면 비밀번호를 묻지 않고 바로 수정, 삭제 가능
if (($member['mb_id'] && ($member['mb_id'] === $list[$i]['mb_id'])) || $is_admin) {
    $update_href = './write.php?w=u&bo_table='.$bo_table.'&wr_id='.$list[$i]['wr_id'].'&page='.$page.$qstr;
    $delete_href ='./delete.php?bo_table='.$bo_table.'&wr_id='.$list[$i]['wr_id'].'&token='.$token.'&page='.$page.urldecode($qstr);
}
else if (!$list[$i]['mb_id']) { // 회원이 쓴 글이 아니라면
    $update_href = './password.php?w=u&bo_table='.$bo_table.'&wr_id='.$list[$i]['wr_id'].'&page='.$page.$qstr;
    $delete_href = './password.php?w=d&bo_table='.$bo_table.'&wr_id='.$list[$i]['wr_id'].'&page='.$page.$qstr;
}
         ?>
 
 <?php if ($delete_href) { ?> <a class="blue_button" href="<?php echo $update_href ?>" >수정</a><?php } ?>
 
<?php if ($update_href) { ?>  <a class="blue_button" href="<?php echo $delete_href ?>"  onclick="del(this.href); return false;">삭제</a><?php } ?>
 
 

이 질문에 댓글 쓰기 :

답변 2

$bo_table 를 $list[$i]['bo_table']로 한번 해보세요

href="<?php echo G5_BBS_URL.'/write.php?w=u&bo_table='.$list[$i]['bo_table'].'&wr_id='.$list[$i]['wr_id'];?>"

 

이렇게 해서 수정 버튼은 적용이 되는데

 

href="<?php echo G5_BBS_URL.'/
                    delete.php?&bo_table='.$list[$i]['bo_table'].'&wr_id='.$list[$i]['wr_id'];?>" 

 

삭제 링크는 토큰 에러로 삭제 불가능이라고 나오네요 ㅠㅠ

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 937
© SIRSOFT
현재 페이지 제일 처음으로