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,616
7년 전 조회 4,321
7년 전 조회 3,950
7년 전 조회 4,206
7년 전 조회 6,776
7년 전 조회 5,031
7년 전 조회 4,794
7년 전 조회 5,302
7년 전 조회 5,076
7년 전 조회 4,455
7년 전 조회 6,487
7년 전 조회 6,982
7년 전 조회 4,980
7년 전 조회 3,584
7년 전 조회 3,850
7년 전 조회 6,545
7년 전 조회 1.1만
7년 전 조회 7,469
7년 전 조회 4,738
7년 전 조회 4,461
7년 전 조회 4,327
7년 전 조회 5,414
7년 전 조회 5,979
7년 전 조회 4,571
7년 전 조회 9,905
7년 전 조회 1.5만
7년 전 조회 4,836
7년 전 조회 5,884
7년 전 조회 3,472
7년 전 조회 3,830