$sql_search [변수 : string]
$sql_search [변수 : string]
-> 파일 내부에서만 생성되는 변수, 검색어가 존재할 경우 생성된다.
-> 리스트나 뷰에서 셀렉트 할때 조건절에 추가된다.
-> 문제점> 물론 그누보드 자체의 검색에서는 $stext가 있는 경우는 $sselect가 없는 경우는 없지만
브라우져주소창에 값을 바로 넘길경우에는 $sselect없이 $stext만 넘길경우에는 쿼리에러를 뿌린다.
따라서 기존의 (bbs/gbviw.php에서 발췌)
if ($stext) {
// where 문을 얻음
$sql_search = get_sql_search($sselect, $stext);
.....
형태가 아니라
if (!empty($sselect) && !empty($stext)) {
// where 문을 얻음
$sql_search = get_sql_search($sselect, $stext, $soperator);
.....
로 고치는 것이 맞다.
-> bbs/gbview.php나 bbs/gbview.php 에서 두군데다 $sql_search를 얻기 위한 부분이 포함되어있다.
그러나 두파일모두 bbs/gnuboard.php이하에 인클루드 되므로 bbs/gnuboard.php에서 공통처리하는것이
바람직하다.
예> bbs/gnuboard.php 106라인에 추가
$sql_search = "";
// 검색이면
if (!empty($sselect) && !empty($stext)) {
// where 문을 얻음
$sql_search = get_sql_search($sselect, $stext, $soperator);
}
그리고 bbs/gbview.php에서는 22부터 32라인 까지는
$search_href = "";
$list_href = "./?doc=bbs/gnuboard.php&bo_table=$bo_table&page=$page";
// 검색이면
if (!empty($sql_search)) {
// where 문을 얻음
$search_href = "./?doc=bbs/gnuboard.php&$qstr&page=$page";
$list_href = "./?doc=bbs/gnuboard.php&bo_table=$bo_table";
}
그리고 bbs/gblist.php에서는
16라인을
if (!empty($sql_search)) {
로 변경
17라인 제거
-> 파일 내부에서만 생성되는 변수, 검색어가 존재할 경우 생성된다.
-> 리스트나 뷰에서 셀렉트 할때 조건절에 추가된다.
-> 문제점> 물론 그누보드 자체의 검색에서는 $stext가 있는 경우는 $sselect가 없는 경우는 없지만
브라우져주소창에 값을 바로 넘길경우에는 $sselect없이 $stext만 넘길경우에는 쿼리에러를 뿌린다.
따라서 기존의 (bbs/gbviw.php에서 발췌)
if ($stext) {
// where 문을 얻음
$sql_search = get_sql_search($sselect, $stext);
.....
형태가 아니라
if (!empty($sselect) && !empty($stext)) {
// where 문을 얻음
$sql_search = get_sql_search($sselect, $stext, $soperator);
.....
로 고치는 것이 맞다.
-> bbs/gbview.php나 bbs/gbview.php 에서 두군데다 $sql_search를 얻기 위한 부분이 포함되어있다.
그러나 두파일모두 bbs/gnuboard.php이하에 인클루드 되므로 bbs/gnuboard.php에서 공통처리하는것이
바람직하다.
예> bbs/gnuboard.php 106라인에 추가
$sql_search = "";
// 검색이면
if (!empty($sselect) && !empty($stext)) {
// where 문을 얻음
$sql_search = get_sql_search($sselect, $stext, $soperator);
}
그리고 bbs/gbview.php에서는 22부터 32라인 까지는
$search_href = "";
$list_href = "./?doc=bbs/gnuboard.php&bo_table=$bo_table&page=$page";
// 검색이면
if (!empty($sql_search)) {
// where 문을 얻음
$search_href = "./?doc=bbs/gnuboard.php&$qstr&page=$page";
$list_href = "./?doc=bbs/gnuboard.php&bo_table=$bo_table";
}
그리고 bbs/gblist.php에서는
16라인을
if (!empty($sql_search)) {
로 변경
17라인 제거
게시판 목록
그누3 사전
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 29 | 20년 전 | 10102 | ||
| 28 | 20년 전 | 8003 | ||
| 27 | 20년 전 | 7316 | ||
| 26 | 20년 전 | 6954 | ||
| 25 | 20년 전 | 7791 | ||
| 24 | 20년 전 | 6895 | ||
| 23 | 20년 전 | 15234 | ||
| 22 | 20년 전 | 5798 | ||
| 21 | 20년 전 | 5890 | ||
| 20 | 20년 전 | 5843 | ||
| 19 | 20년 전 | 5285 | ||
| 18 | 20년 전 | 5349 | ||
| 17 | 20년 전 | 5826 | ||
| 16 | 20년 전 | 7329 | ||
| 15 | 20년 전 | 5653 | ||
| 14 | 20년 전 | 7236 | ||
| 13 | 20년 전 | 5672 | ||
| 12 | 20년 전 | 6461 | ||
| 11 | 20년 전 | 8421 | ||
| 10 | 20년 전 | 7063 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기