짧은 검색 구현
예를 들어 그누보드가 적용된 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년 전 | 4402 | ||
| 2454 |
|
1년 전 | 1124 | |
| 2453 | 1년 전 | 1057 | ||
| 2452 | 1년 전 | 1623 | ||
| 2451 | 1년 전 | 1155 | ||
| 2450 | 1년 전 | 958 | ||
| 2449 | 1년 전 | 1338 | ||
| 2448 | 1년 전 | 884 | ||
| 2447 | 1년 전 | 1339 | ||
| 2446 | 1년 전 | 1416 | ||
| 2445 | 1년 전 | 1129 | ||
| 2444 | 1년 전 | 1284 | ||
| 2443 | 1년 전 | 1678 | ||
| 2442 | 1년 전 | 1488 | ||
| 2441 | 1년 전 | 1071 | ||
| 2440 | 1년 전 | 1179 | ||
| 2439 | 1년 전 | 4621 | ||
| 2438 | 1년 전 | 1078 | ||
| 2437 | 1년 전 | 1118 | ||
| 2436 | 1년 전 | 928 | ||
| 2435 | 1년 전 | 1562 | ||
| 2434 | 1년 전 | 1455 | ||
| 2433 | 1년 전 | 1019 | ||
| 2432 |
|
1년 전 | 613267 | |
| 2431 |
|
1년 전 | 1095 | |
| 2430 |
|
1년 전 | 1708 | |
| 2429 | 1년 전 | 1313 | ||
| 2428 | 1년 전 | 1273 | ||
| 2427 | 1년 전 | 1150 | ||
| 2426 | 1년 전 | 1112 | ||
| 2425 |
뽕엄능브라
|
1년 전 | 1235 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기