권장 : 필터를 사용하여 보조 정보 검색을 달성하십시오 질문에 대해 생각해보십시오 : 첫 번째 검색을 기반으로 보조 검색을 달성하는 방법은 무엇입니까? 일반적으로 첫 번째 검색 중 검색 조건을 저장하고 두 번째 행 검색 중 두 가지 검색 조건을 결합하여 다음과 같은 데이터베이스에서 새 쿼리를 수행하는 것입니다.
'----------------------------------------------------------------------------------
'기능 기능 : 블록 HTML 코드
'매개 변수 : strinput 사용자 입력 정보
'----------------------------------------------------------------------------------
기능 funinput (strinput)
그렇지 않다면 (str)
strinput = replace (strinput, <, <)
strinput = replace (strinput,>,>)
strinput = replace (strinput, chr (32),)
strinput = replace (strinput, chr (34),)
strinput = replace (strinput, chr (39), ')
strinput = replace (strinput, chr (13),)
funInput = strinput
끝 If
엔드 기능
'----------------------------------------------------------------------------------
'기능 기능 : SQL 주입 방지
'매개 변수 : Strvalue 사용자 제출 데이터
'블로 타입 데이터 유형
'매개 변수 값 : 실제 숫자 데이터
'허위 문자 데이터
'----------------------------------------------------------------------------------
기능 funsql (strvalue, blotype)
그렇다면 블로 타입
isnumeric (strvalue)이면
funsql = clng (strvalue)
또 다른
strvalue = 0
끝 If
또 다른
그렇지 않다면 (strvalue)
strvalue = lcase (strvalue)
strvalue = replace (strvalue, ',' ')
strvalue = replace (strvalue, select,)
strvalue = 교체 (strvalue, update,)
strvalue = replace (strvalue, insert,)
strvalue = replace (strvalue, delete,)
strvalue = replace (strvalue, ;,)
strvalue = replace (strvalue ,,)
strvalue = replace (strvalue, chr (255),)
strvalue = replace (strvalue,*,)
strvalue = 교체 (strvalue,%,)
끝 If
끝 If
funsql = strvalue
엔드 기능
'----------------------------------------------------------------------------------
'기능 기능 : 공통 유형 변환
'매개 변수 : _type 데이터 유형
'_value 데이터
'매개 변수 값 : _type 1 : 숫자 데이터로 변환
'_type 2 : 문자 데이터로 변환
'_type 3 : 부울 데이터로 변환
'----------------------------------------------------------------------------------
기능 Funswitch (value_, type_)
다음에 오류가 재개됩니다
CASE Type_ 선택
사례 1
isnumeric (value_)이면
그렇지 않다면 (value_)
funswitch = clng (value_)
또 다른
펀 스위치 = 0
끝 If
또 다른
펀 스위치 = 0
끝 If
사례 2
그렇지 않다면 (value_)
funswitch = cstr (value_)
또 다른
Funswitch =
끝 If
사례 3
그렇지 않은 경우 (value_) 및 isnumeric (value_)
Funswitch = cbool (value_)
또 다른
funswitch = false
끝 If
다른 경우
response.redirect (error.asp? err = Funswitch에서 전송할 데이터 유형을 지정하십시오!)
종료 선택
err.number <> 0 인 경우
response.redirect (error.asp? err = 데이터 변환 중에 알 수없는 오류가 발생했습니다!)
err.clear
끝 If
엔드 기능
'------------------------------------------------------------------------------
'기능 기능 : 데이터가 외부에서 오는지 확인
'매개 변수 : 없음
'----------------------------------------------------------------------------------
함수 checkrom ()
server_v1 = cstr (request.servervariables (http_referer))
server_v2 = cstr (request.servervariables (server_name))
MID (server_v1,8, len (server_v2)) <> server_v2입니다
checkfrom = true
또 다른
checkfrom = false
끝 If
엔드 기능
'------------------------------------------------------------------------------
'기능 기능 : JS 프롬프트 상자
'매개 변수 : strurl : 확인을 클릭 한 후 페이지 주소가 반환되었습니다.
'strmsg : 대화 프롬프트 정보
'----------------------------------------------------------------------------------
기능 funmsg (strurl, strmsg)
response.write <script language = 'javaScript'> & _
vbcrlf & Alert (& strmsg &); & _
vbcrlf & window.location = & strurl &; & _
vbcrlf & </script>
엔드 기능
'----------------------------------------------------------------------------------
'기능 기능 : 일반 페이징
'매개 변수 : intpagecount Total Page Count
'intmypage 현재 페이지 수
'IntrecordCount Total Records
'페이지 당 표시되는 레코드 수를 intpagesize
'----------------------------------------------------------------------------------
함수 펀 페이지 (intpagecount, intmypage, intrecordcount, intpagesize)
'오류로 이력서에 다음에
Dim Intfor, intlist, intlist_b
딤 쿼리, a, x, temp
action = http : // & request.servervariables (http_host) & request.servervaribles (script_name)
query = split (request.servervariables (query_string), &)
쿼리의 각 X에 대해
a = split (x, =)
strcomp (a (0), page, vbtextcompare) <> 0 인 경우
temp = temp & a (0) & = & a (1) & &
끝 If
다음
intmypage> 1이면
funpage = funpage & <a href = '& action &? & temp & page = 1'title = '마지막 페이지'class = 'no'> <font face = 'Webdings'> 9 </font> </a>
funpage = funpage & <a href = '& action &? & temp &?
또 다른
FUNPAGE = FUNPAGE & <font face = 'Webdings'> 9 </font>
FUNPAGE = FUNPAGE & <font face = 'Webdings'> 7 </font>
끝 If
intlist <> 0이면
cintmypage = intlist라면
intlist = intlist 5
끝 If
또 다른
intlist = intmypage 5
끝 If
intlist-9 <1 인 경우
intlist_b = 1
또 다른
intlist_b = intlist-9
끝 If
intfor = intlist_b, intlist의 경우
intfor <= intpagecount 인 경우
intfor = intmypage 인 경우 '---- 현재 페이지의 텍스트를 빨간색으로 만들고 클릭 할 수 없습니다.
Funpage = funpage & strmode & <font color = '#ff0000'> <b> & intfor & </b> </font>
또 다른
FUNPAGE = FUNPAGE & STRMODE & <a href = '& action &? & temp & page = & intfor &'class = 'no'> & intfor & </a>
끝 If
끝 If
strmode = <font color = '#bbbbbb'> | </font>
다음
intmypage <intpagecount라면
funpage = funpage & <a href = '& action &? & temp &?
funpage = funpage & <a href = '& action &? & temp & page = & intpagecount &'title = 'last page'class = 'no'> <font face = 'webdings'> : </font> </a>
또 다른
FUNPAGE = FUNPAGE & <font face = 'Webdings'> 8 </font>
FUNPAGE = FUNPAGE & <font face = 'Webdings'> : </font> </a>
끝 If
funpage = <테이블 width = '100%'border = '0'cellPacing = '0'cellPadding = '0'> <tr> & _
vbcrlf & <td width = '40%'style = font : 14px> 현재 & intmypage & page & intpagesize & list/page total & intpagecount & page/& intrecordcount & list records </td> & _
vbcrlf & <td width = '60%'align ='right '> & _
vbcrlf & <테이블 width = '360'border = '0'CellPacing = '0'CellPadding = '0'CellPadding = '0'> <tr> & _
vbcrlf & <td align = 'right'style = font : 14px> & funpage & </td> & _
vbcrlf & </tr> </table> </td> </tr> & _
vbcrlf & </table>
err.number <> 0 인 경우
err.clear
response.redirect (error.asp? err = 페이지 매김 함수에 오류가 있습니다. 관리자에게 문의하십시오! |)
끝 If
엔드 기능
'*****************************************************
'기능 이름 : 하이라이트
'기능 : 검색 키워드가 강조 표시된 색상으로 표시됩니다
'매개 변수 strtext는 문자열 또는 변수가 강조 표시되는 문자열 또는 변수입니다.
'strfind는 강조 표시되는 문자열 또는 변수입니다.
'strbe prore Highlighted Html 코드 접두사는 다음과 같습니다. <font color = red>
'Strafter는 HTML 코드 접미사를 강조했습니다. </font>
'*************************************************************
기능 하이라이트 (strtext, strfind, strbefore, Strafter)
희미한 npos
Dim Nlen
Dim nlenall
nlen = Len (strfind)
nlenall = nlen len (strbefore) len (strafter) 1
하이라이트 = strtext
NLEN> 0 및 LEN (하이라이트)> 0 인 경우
npos = instr (1, 하이라이트, strfind, 1)
NPOS> 0 동안
하이라이트 = 왼쪽 (하이라이트, NPO -1) & _
strbefore & mid (하이라이트, npos, nlen) & strafter & _
MID (하이라이트, NPOS NLEN)
npos = instr (npos nlenall, 하이라이트, strfind, 1)
고리
끝 If
엔드 기능
공유 : ASP 3.0 고급 프로그래밍 (31) 7.1.2 시맨틱 또는 런타임 오류의 검색 및 처리는 성가 시지만, 프로그래밍에서 정말 흥미로운 다른 유형의 오류 - 시맨틱 오류 (시맨틱 오류) 또는 & LD를 만나게됩니다.