짧은 검색 구현
예를 들어 그누보드가 적용된 dsclub.kr/search/?검색어 로 접속 시
웹 서버 디렉토리(루트 폴더 안)에 search폴더를 만들고, /search로 이동.
index.php파일 생성, 아래의 코드를 삽입(dsclub.kr을 원하는 도메인으로 변경)
<?php
$uri = $_SERVER['REQUEST_URI'];]
$parts = explode('/', $uri);
$search_index = array_search('search', $parts);
if ($search_index !== false && count($parts) > $search_index + 1) {
$search_value = $parts[$search_index + 1];
$redirect_url = "https://dsclub.kr/bbs/search.php?sfl=wr_subject%7C%7Cwr_content%7C%7Cmb_id%7C%7Cwr_name%7C%7Cwr_datetime%7C%7Cwr_link%7C%7Cwr_ip&sop=and&stx=" . $search_value;
header("Location: " . $redirect_url);
}
?>
그 후 (예를 들어) dsclub.kr/search/?test 으로 접속하면 test 검색 가능
댓글 4개
민트다이어리
1년 전
감사합니다. ^^
1년 전
와우 심플 단순 감사합니다
DawnDew
1년 전
감사합니다
marty72
1년 전
정말 유용한 기능이네요! 공유 감사드립니다.. 추천 꾹!!
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4404 | ||
| 2364 | 1년 전 | 1635 | ||
| 2363 | 1년 전 | 2109 | ||
| 2362 |
디지털홍익인간
|
1년 전 | 1256 | |
| 2361 | 1년 전 | 2034 | ||
| 2360 |
parkee
|
1년 전 | 929 | |
| 2359 | 1년 전 | 1654 | ||
| 2358 | 2년 전 | 1379 | ||
| 2357 | 2년 전 | 2652 | ||
| 2356 | 2년 전 | 1651 | ||
| 2355 |
타버린나무
|
2년 전 | 1859 | |
| 2354 | 2년 전 | 2388 | ||
| 2353 |
swallow
|
2년 전 | 2363 | |
| 2352 | 2년 전 | 1511 | ||
| 2351 | 2년 전 | 1592 | ||
| 2350 |
|
2년 전 | 1480 | |
| 2349 | 2년 전 | 1291 | ||
| 2348 | 2년 전 | 2378 | ||
| 2347 | 2년 전 | 2494 | ||
| 2346 |
ceramoon
|
2년 전 | 1534 | |
| 2345 | 2년 전 | 1274 | ||
| 2344 | 2년 전 | 1678 | ||
| 2343 | 2년 전 | 2408 | ||
| 2342 | 2년 전 | 1645 | ||
| 2341 | 2년 전 | 1178 | ||
| 2340 | 2년 전 | 2530 | ||
| 2339 | 2년 전 | 1222 | ||
| 2338 | 2년 전 | 1400 | ||
| 2337 | 2년 전 | 1710 | ||
| 2336 | 2년 전 | 2004 | ||
| 2335 | 2년 전 | 2281 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기