미니 검색창에서 특정 게시판 검색하려고합니다. 정보
미니 검색창에서 특정 게시판 검색하려고합니다.본문
메인쪽에서 미니 검색창을 통에서 특정 게시판 검색하려고합니다.
<form name='frmsearch1' id="frmsearch1" style='margin:0px;' onsubmit='return search_submit(this);'>
<input type='hidden' name='sfl' value='wr_subject||wr_content' />
<input type='hidden' name='sop' value='and' />
<input type='hidden' name='stx' value='' /></td>
<select name='search_flag' id='search_flag' class='small' style="width:80px;">
<option value='강좌명'>강좌명</option>
<option value='강사명'>강사명</option>
</select>
<input name="search_str" type="text" class='ed' value='<?=stripslashes(get_text($search_str))?>' size="20" />
<input name="image" type="image" src='/images/search.gif' align="absmiddle" border="0" /></form>
<script>
function search_submit(f) {
if (f.search_flag.value == '검색') {
f.action = '<?=$g4[path]?>/search.php';
} else {
f.stx.value = f.search_str.value;
f.action = '<?=$g4[path]?>/search.php';
}
}
<?
if ($search_flag) {
echo "document.getElementById('search_flag').value = '$search_flag';";
}
?>
</script>
/bbs/board.php?bo_table=31&sca=&sfl=wr_subject&stx=검색단어
검색테이블은 wr_1 과 wr_2 를 골라서 검색한다고 가능하에...
이런식으로 링크를 보내려고합니다..
고수님들 많은 도움부탁드립니다.
<form name='frmsearch1' id="frmsearch1" style='margin:0px;' onsubmit='return search_submit(this);'>
<input type='hidden' name='sfl' value='wr_subject||wr_content' />
<input type='hidden' name='sop' value='and' />
<input type='hidden' name='stx' value='' /></td>
<select name='search_flag' id='search_flag' class='small' style="width:80px;">
<option value='강좌명'>강좌명</option>
<option value='강사명'>강사명</option>
</select>
<input name="search_str" type="text" class='ed' value='<?=stripslashes(get_text($search_str))?>' size="20" />
<input name="image" type="image" src='/images/search.gif' align="absmiddle" border="0" /></form>
<script>
function search_submit(f) {
if (f.search_flag.value == '검색') {
f.action = '<?=$g4[path]?>/search.php';
} else {
f.stx.value = f.search_str.value;
f.action = '<?=$g4[path]?>/search.php';
}
}
<?
if ($search_flag) {
echo "document.getElementById('search_flag').value = '$search_flag';";
}
?>
</script>
/bbs/board.php?bo_table=31&sca=&sfl=wr_subject&stx=검색단어
검색테이블은 wr_1 과 wr_2 를 골라서 검색한다고 가능하에...
이런식으로 링크를 보내려고합니다..
고수님들 많은 도움부탁드립니다.
댓글 전체
해당 submit은 post로 보내시고 <input type='hidden' name='bo_table' value='게시판테이블명' />를 추가하시면 될껍니다.
<form name='frmsearch1' id="frmsearch1" style='margin:0px;' action = '<?=$g4[path]?>/bbs/board.php'>
<input type='hidden' name='bo_table' value='31' />
<input type='hidden' name='sca' value='' />
<input type='hidden' name='sop' value='and' />
<select name='sfl' id='sfl' style="width:80px;">
<option value='wr_1'>강좌명</option>
<option value='wr_2'>강사명</option>
</select>
<input name="stx" type="text" value='<?=stripslashes(get_text($stx))?>' size="20" />
<input name="image" type="image" src='/images/search.gif' align="absmiddle" border="0" />
</form>
<input type='hidden' name='bo_table' value='31' />
<input type='hidden' name='sca' value='' />
<input type='hidden' name='sop' value='and' />
<select name='sfl' id='sfl' style="width:80px;">
<option value='wr_1'>강좌명</option>
<option value='wr_2'>강사명</option>
</select>
<input name="stx" type="text" value='<?=stripslashes(get_text($stx))?>' size="20" />
<input name="image" type="image" src='/images/search.gif' align="absmiddle" border="0" />
</form>
좋은 팁입니다~ 이거는 추천 누르는거 없나요? ㅎ