j

검색 한글자 완벽히 막자

common.lib.php

 

// 검색어 특수문자 제거
function get_search_string($stx)
{
    $stx_pattern = array();
    $stx_pattern[] = '#\.*/+#';
    $stx_pattern[] = '#\\\*#';
    $stx_pattern[] = '#\.{2,}#';
    $stx_pattern[] = '#[/\'\"%=*\#\(\)\|\+\&\!\$~\{\}\[\]`;:\?\^\,]+#';
    $stx_pattern[] = '/^[0-9]{1}$/';
    $stx_pattern[] = '/^[a-z]{1}$/';
    $stx_pattern[] = '/^[A-Z]{1}$/';

    $stx_replace = array();
    $stx_replace[] = '';
    $stx_replace[] = '';
    $stx_replace[] = '.';
    $stx_replace[] = '';

    $stx = preg_replace($stx_pattern, $stx_replace, $stx);

    return $stx;
}

 

https://xxx.net/bbs/search.php?url=https%3A%2F%2Fxxx.net%2Fbbs%2Fsearch.php&stx=n&search=

 

브라우저에서 위에처럼 주소 치고 검색 시 검색이 가능하고 인기 검색어관리에 표시가 됩니다.

그럴 때 이 기능을 사용합니다.

 

만약 틀리면 댓글달아주세요. 뿅~

|

댓글 3개

자바스크립트를 끄고 검색하면 뚫리지 않나요?
그런것도 있나요? ㅡ.ㅡ;?
크롬 개발자모드에서 disable javascript 하면 됩니다
댓글을 작성하시려면 로그인이 필요합니다.

그누보드5 팁자료실

+
제목 글쓴이 날짜 조회
7년 전 조회 5,550
7년 전 조회 4,242
7년 전 조회 3,882
7년 전 조회 4,127
7년 전 조회 6,690
7년 전 조회 4,955
7년 전 조회 4,730
7년 전 조회 5,236
7년 전 조회 4,997
7년 전 조회 4,371
7년 전 조회 6,372
7년 전 조회 6,910
7년 전 조회 4,913
7년 전 조회 3,518
7년 전 조회 3,785
7년 전 조회 6,465
7년 전 조회 1.1만
7년 전 조회 7,355
7년 전 조회 4,670
7년 전 조회 4,385
7년 전 조회 4,266
7년 전 조회 5,308
7년 전 조회 5,912
7년 전 조회 4,506
7년 전 조회 9,802
7년 전 조회 1.4만
7년 전 조회 4,762
7년 전 조회 5,820
7년 전 조회 3,411
7년 전 조회 3,774