추천 라디오 버튼 오류좀 봐주십시요..ㅠ.ㅠ
//skin/board/basic/view.skin.php//내용
<script>
function good_ch(bo_table,wr_id,wr_chu_Num) {
var strURL;
var strName;
var strFeature;
strURL ="good.php?bo_table="+ bo_table + "&wr_id=" + wr_id + "&wr_chu_Num=" +wr_chu_Num;
strName = 'TeacherViewBOX';
strFeature = "width=200, height=200, menubar=no, status=no, location=no,resizable=no, toolbar=no, scrollbars=yes";
window.open(strURL, strName, strFeature);
}
</script>
<!--추천버튼 시작 -->
<table align='center' border='0' cellpadding='2' cellspacing='0' width='100%' bgcolor='#CFCFCF'>
<tr>
<td align='center' height='20'>
<b>추천점수</b>
<input type='radio' name='good_ch' value='1'>1
<input type='radio' name='good_ch' value='2'>2
<input type='radio' name='good_ch' value='3' checked>3
<input type='radio' name='good_ch' value='4'>4
<input type='radio' name='good_ch' value='5'>5
<input type='button' value='점수주기' style='font-size:9pt' onClick='javascript:good_ch()'></td>
</tr>
</table>
<!--추천버튼 끝 -->
//////////////////////////////////////////////////////
/////////////////////////////////////////////////////
이렇게 작성해서 추천을적용해보니
알트창문구↓↓↓
//
해당게시물에서만 추천 또는 비추천을 하실수 있습니다.
//
어떤부분이 잘못됐는지 좀알려주십시요..
완전초보라 어딜손봐야될지 모르겠습니다.
<script>
function good_ch(bo_table,wr_id,wr_chu_Num) {
var strURL;
var strName;
var strFeature;
strURL ="good.php?bo_table="+ bo_table + "&wr_id=" + wr_id + "&wr_chu_Num=" +wr_chu_Num;
strName = 'TeacherViewBOX';
strFeature = "width=200, height=200, menubar=no, status=no, location=no,resizable=no, toolbar=no, scrollbars=yes";
window.open(strURL, strName, strFeature);
}
</script>
<!--추천버튼 시작 -->
<table align='center' border='0' cellpadding='2' cellspacing='0' width='100%' bgcolor='#CFCFCF'>
<tr>
<td align='center' height='20'>
<b>추천점수</b>
<input type='radio' name='good_ch' value='1'>1
<input type='radio' name='good_ch' value='2'>2
<input type='radio' name='good_ch' value='3' checked>3
<input type='radio' name='good_ch' value='4'>4
<input type='radio' name='good_ch' value='5'>5
<input type='button' value='점수주기' style='font-size:9pt' onClick='javascript:good_ch()'></td>
</tr>
</table>
<!--추천버튼 끝 -->
//////////////////////////////////////////////////////
/////////////////////////////////////////////////////
이렇게 작성해서 추천을적용해보니
알트창문구↓↓↓
//
해당게시물에서만 추천 또는 비추천을 하실수 있습니다.
//
어떤부분이 잘못됐는지 좀알려주십시요..
완전초보라 어딜손봐야될지 모르겠습니다.
첨부파일
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기
댓글 3개
그냥 새창으로 열어서 추천을 할경우 세션이 생성되지 않기 때문에 이러한 증상이 나타납니다.
이러한 경우 여러가지 방법이 있습니다.
1. 새로운 페이지를 하나 만들어서 추천 시 만든 새 페이지를 띄우고 새 페이지에서 세션값을 생성해준후 good.php를 인클루드한다
2. 새로운 페이지를 만들어 그냥 추천하는 쿼리만 코딩해서 연결한다.
등등이 있는데 꼬부기0님한테는 그냥
good.php에서
$ss_name = "ss_view_{$bo_table}_{$wr_id}";
if (!get_session($ss_name))
alert_close("해당 게시물에서만 추천 또는 비추천 하실 수 있습니다.");
이 부분을 지우면 됩니다;; 여러가지 응용방법을 알려주려다 보니 괘니 쓸때없는 서술이 길었습니다;
그냥 저 세줄 지우라고 하면 될걸;;;
function good_ch(bo_table,wr_id,wr_chu_Num) <- , 로 구분된 3가지 값을 받아 오게 되어 있습니다.
<input type='radio' name='good_ch' value='1' onclick('테이블명',게시물고유번호, '추천번호')>1
이렇게 쓰시라고 알려 드린건데요 -_-;;
good.php 상단에 ...
include_once("./_common.php");
일단 선언 하시면 거의 모든 그누 값들이 다 올라 옵니다.
이제 남은건 님께서 처리하는 로직인데요 -_-;;;
지금같이 처리하시면 어떤 테이블에 어떤 게시물 어떤 값을 받았는지 모릅니다 ㅠ.ㅠ
good.php
대략적인 코딩 입니다 ㅠ.ㅠ
include_once("./_common.php");
if ($bo_table || $wr_id ||$wr_chu_Num) {
alert("정상적인 방법으로 접근하십시오");
}
$g4_good_table = "추천테이블명"; // 원래 선언된 변수가 있으나 제가 귀찮아서 --;;
$sql1 = "UPDATE $g4_good_table SET
추천값 넣는곳 = $wr_chu_Num <-- 이렇게 추천값 넣어주시면 되겠죠
WHERE 추천 게시물 값 넣는곳 = $wr_id AND 테이블명필드 = '$bo_table'";
$rst1= sql_query($sql1);
if ($rst1) {
// 그누에 자동 이동하는 방법이 있으나 창을 닫고 이동해야 하니 임시적으로
echo"
<script>
alert("정상적으로 처리가 되었습니다\\n확인을 누르시면 창이 닫힙니다");
opener.location.reload()
self.close();
</script>
} else {
echo" 큰일났다 ! ~~ <br> 에러문 -_-;; ";
}
뭐 대충 이정도가 되겠습니다.
물런 view 기능에 대한 처리도 하시야 겠지만요.
제능력으론 안되네요..^^
신경써주셔서 감사합니다 ..