하 돌겟네
본문
댓글부분인데 내가 입력한 댓글이 아니여도 내가 지울수있다는건데..
왜 지워지는거죠 ㄷㄷ
$sql = "select * from {$comment_count}
where fr_password='{$member['fr_password']}' ";
$result = sql_query($sql);
$data = sql_fetch_array($result);
if($member['fr_admin_auth'] == "admin"){
}else{
if($data['fr_password']!=$member['fr_password']){
Error('잘못된 접근입니다.');
}
}
sql_query(" delete from {$comment_count} where fr_no='{$fr_no}' ");
sql_query(" update {$fr_board} set fr_comment=fr_comment-1 where fr_no='{$view_no}' and bo_table='{$bo_table}' ");
goto_url('./view.php?fr_no='.$view_no.'&bo_table='.$bo_table.'&page='.$page.'&Search_mode='.$Search_mode.'&Search_text='.$Search_text.'');
왜 지워지는거죠 ㄷㄷ
$sql = "select * from {$comment_count}
where fr_password='{$member['fr_password']}' ";
$result = sql_query($sql);
$data = sql_fetch_array($result);
if($member['fr_admin_auth'] == "admin"){
}else{
if($data['fr_password']!=$member['fr_password']){
Error('잘못된 접근입니다.');
}
}
sql_query(" delete from {$comment_count} where fr_no='{$fr_no}' ");
sql_query(" update {$fr_board} set fr_comment=fr_comment-1 where fr_no='{$view_no}' and bo_table='{$bo_table}' ");
goto_url('./view.php?fr_no='.$view_no.'&bo_table='.$bo_table.'&page='.$page.'&Search_mode='.$Search_mode.'&Search_text='.$Search_text.'');
답변 1
댓글 비번과 회원 비번이 같은 것을 찾아서
관리자가 아니면 잘못된 접근입니다??
이건 말이 좀 안되는 상황을 만든 것 같습니다
1. 비회원인 경우
$data['fr_password']!=$member['fr_password' <--> 양쪽이 같게 됩니다(양쪽모두 값이 없으니)
따라서 통과되어 삭제 쿼리가 실행 됨
2. 회원인 경우
내 비밀번호와 같은 비번을 입력한 글은 지울 수 있게됩니다
3. $result = sql_query($sql);
$data = sql_fetch_array($result);
위쪽 쿼리는 모두 찾아라
두번째는 구한 쿼리 중에서 첫번째 것만 값을 구하라
이렇게 하는 것이 아니고 아래처럼
$data = sql_fetch($sql);
4. Error('잘못된 접근입니다.'); <--- Error라는 함수를 만들었다는 것인가요?
답변을 작성하시기 전에 로그인 해주세요.