검색창 특수문자 제거? 허용?

검색창 특수문자 제거? 허용?

QA

검색창 특수문자 제거? 허용?

답변 1

본문


if ($stx != "") {
   
    // $stx = get_search_string($stx);
    if ($sfl != "") {
       
        $sql_search .= " $where $sfl like '%$stx%' ";
        $where = " and ";
    }
    if ($save_stx != $stx)
        $page = 1;
}
 
$qstr  = $qstr.'&sca='.$sca.'&page='.$page.'&save_stx='.$stx;

 

코드는 이런식이구요 

[위니아]눈마사지기 이 단어를 검색하게 되면 

https://생략url/adm/shop_admin/itemlist.php?token=2d0512921f8ea02805c7ab35231b5280&save_stx=&sca=&sfl=it_name&stx=%5B위니아%5D+눈마사지기

라고 url변경때문에 검색이 안됩니다ㅠㅠㅠ

근데 또 [위니아] 이거는 검색이되는데 특수문자를 살려야 검색이 되는것인지 제거를 해야하는지 아니면 페이지 자체에서 막고있는건지 궁금합니다ㅠㅠ 

 

이 질문에 댓글 쓰기 :

답변 1

if (!empty($stx)) {
    $decoded_stx = urldecode($stx);
    
    if (!empty($sfl)) {
        $sql_search .= " $where $sfl like ?";
        $where = " and ";
    }
    if ($save_stx != $stx) {
        $page = 1;
    }
}

$qstr = $qstr . '&sca=' . urlencode($sca) . '&page=' . $page . '&save_stx=' . urlencode($stx);

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 277
© SIRSOFT
현재 페이지 제일 처음으로