검색창까지 달았는데... 검색결과를 뿌려주려면 어떻게 해야죠? 정보
검색창까지 달았는데... 검색결과를 뿌려주려면 어떻게 해야죠?본문
여기 들어가서 부탁드려요~ ㅜㅜ
소스는
<?
include_once("./_common.php");
include_once("$g4[path]/lib/outlogin.lib.php"); //아웃로그인
include_once("$g4[path]/lib/poll.lib.php"); //설문조사
include_once("$g4[path]/lib/visit.lib.php"); //방문자
include_once("$g4[path]/lib/connect.lib.php"); //현재접속자
include_once("$g4[path]/lib/popular.lib.php"); //인기검색어
include_once("$g4[path]/lib/latest.lib.php"); //최신글
?>
include_once("./_common.php");
include_once("$g4[path]/lib/outlogin.lib.php"); //아웃로그인
include_once("$g4[path]/lib/poll.lib.php"); //설문조사
include_once("$g4[path]/lib/visit.lib.php"); //방문자
include_once("$g4[path]/lib/connect.lib.php"); //현재접속자
include_once("$g4[path]/lib/popular.lib.php"); //인기검색어
include_once("$g4[path]/lib/latest.lib.php"); //최신글
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>무제 문서</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
</head>
<html>
<head>
<title>무제 문서</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
</head>
<body>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"> <table width="100%" height="44" cellspacing="0" cellpadding="0" align="right" background="<?=$g4[path]?>/img/search_bg.gif">
<form name="fsearchbox" method="get" action="javascript:fsearchbox_submit(document.fsearchbox);">
<input type="hidden" name="sfl" value="wr_subject">
<input type="hidden" name="sop" value="and">
<tr>
<td width="5" height="42"></td>
<td width="68" align="center" style="padding-top:1px;">
<?
$group_select = "<select id='gr_id' name='gr_id'><option value=''>통합검색 ▒";
$sql = " select gr_id, gr_subject from $g4[group_table] order by gr_id ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
$group_select .= "<option value='$row[gr_id]'>$row[gr_subject]";
$group_select .= "</select>";
?>
<?=$group_select?>
</td>
<td width="5"></td>
<td width="300" valign="middle" align="right"> <input name="stx" type="text" class="text_box" tabindex="1" value="" size="40"></td>
<td width="5"></td>
<td width="53" align="right"> <input type="image" src="<?=$g4[path]?>/img/search_button.gif" width="51" height="22" border="0"></td>
<td width="6"></td>
</tr>
</form>
</table>
<script language="JavaScript">
function fsearchbox_submit(f)
{
if (f.stx.value == '')
{
alert("검색어를 입력하세요.");
f.stx.select();
f.stx.focus();
return;
}
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3"> <table width="100%" height="44" cellspacing="0" cellpadding="0" align="right" background="<?=$g4[path]?>/img/search_bg.gif">
<form name="fsearchbox" method="get" action="javascript:fsearchbox_submit(document.fsearchbox);">
<input type="hidden" name="sfl" value="wr_subject">
<input type="hidden" name="sop" value="and">
<tr>
<td width="5" height="42"></td>
<td width="68" align="center" style="padding-top:1px;">
<?
$group_select = "<select id='gr_id' name='gr_id'><option value=''>통합검색 ▒";
$sql = " select gr_id, gr_subject from $g4[group_table] order by gr_id ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
$group_select .= "<option value='$row[gr_id]'>$row[gr_subject]";
$group_select .= "</select>";
?>
<?=$group_select?>
</td>
<td width="5"></td>
<td width="300" valign="middle" align="right"> <input name="stx" type="text" class="text_box" tabindex="1" value="" size="40"></td>
<td width="5"></td>
<td width="53" align="right"> <input type="image" src="<?=$g4[path]?>/img/search_button.gif" width="51" height="22" border="0"></td>
<td width="6"></td>
</tr>
</form>
</table>
<script language="JavaScript">
function fsearchbox_submit(f)
{
if (f.stx.value == '')
{
alert("검색어를 입력하세요.");
f.stx.select();
f.stx.focus();
return;
}
/*
// 검색에 많은 부하가 걸리는 경우 이 주석을 제거하세요.
var cnt = 0;
for (var i=0; i<f.stx.value.length; i++)
{
if (f.stx.value.charAt(i) == ' ')
cnt++;
}
// 검색에 많은 부하가 걸리는 경우 이 주석을 제거하세요.
var cnt = 0;
for (var i=0; i<f.stx.value.length; i++)
{
if (f.stx.value.charAt(i) == ' ')
cnt++;
}
if (cnt > 1)
{
alert("빠른 검색을 위하여 검색어에 공백은 한개만 입력할 수 있습니다.");
f.stx.select();
f.stx.focus();
return;
}
*/
{
alert("빠른 검색을 위하여 검색어에 공백은 한개만 입력할 수 있습니다.");
f.stx.select();
f.stx.focus();
return;
}
*/
f.action = "<?=$g4['bbs_path']?>/search.php";
f.submit();
}
</script>
</td>
</tr>
<tr>
<td width="122">
<?=outlogin("outlogin_wa");?>
</td>
<td colspan="2"><?=latest("movie", "12", 5, 50);?></td>
</tr>
<tr>
<td><?=poll("basic"); // 설문조사 ?></td>
<td colspan="2"><?=latest("basic", "sd", 5, 50);?></td>
</tr>
<tr>
<td><?=visit("basic"); // 방문자수 ?></td>
<td width="92"> </td>
<td width="286"> </td>
</tr>
</table>
</body>
</html>
f.submit();
}
</script>
</td>
</tr>
<tr>
<td width="122">
<?=outlogin("outlogin_wa");?>
</td>
<td colspan="2"><?=latest("movie", "12", 5, 50);?></td>
</tr>
<tr>
<td><?=poll("basic"); // 설문조사 ?></td>
<td colspan="2"><?=latest("basic", "sd", 5, 50);?></td>
</tr>
<tr>
<td><?=visit("basic"); // 방문자수 ?></td>
<td width="92"> </td>
<td width="286"> </td>
</tr>
</table>
</body>
</html>
댓글 전체
검색하니깐 잘 되는것 같은데요..^__^
해결했습니다.