Recommended: Reveal the secret method to solve the problem of accidentally deleting asp files of antivirus software Some antivirus software often deletes certain asp files as viruses, and sometimes it is impossible to prevent them. The program is inexplicably unable to use it because there are fewer files~~. This is mainly because the antivirus software treats certain asp codes as Trojan keywords and saves records, so when there is this keyword, it will be prohibited from running or deleting. The solution is to give these keywords to
First, create an access database. There is a URLINDEX table in the library, where the URL and Keywords fields are respectively indexed, as follows:| URL text (index: with (no duplication)) Title text Description Text Summary text Keywords text (index: with (no duplication)) |
Program file doquery.asp, code:
| <HTML><HEAD><TITLE>Simple Search Engine</TITLE></HEAD> <BODYBGCOLOR=#ffffffMARGINWIDTH=0MARGINHEIGHT=0 LEFTMARGIN=0TOPMARGIN=0> <FORMMETHOD=postACTION=doquery.asp?act=search> Query:<INPUTTYPE=TextNAME=QueryString><BR> <INPUTTYPE=SubmitVALUE=Submit> </FORM> </CENTER> <% dimact act=request(act) if(act=search)then QueryString=Request.form(QueryString) QueryWords=Split(QueryString) strIndent= 'If the search is empty, return IfQueryString=Then Response.Redirect(default.asp) EndIf Session.timeout=2 IfIsObject(Session(sitesearch_conn))Then Setconn=Session(sitesearch_conn) Else Setconn=Server.CreateObject(ADODB.Connection) conn.opendriver={Microsoft AccessDriver(*.mdb)};dbq=&Server.MapPath(database/SiteSearch.mdb),, SetSession(sitesearch_conn)=conn EndIf 'Query statement sql=SELECT*FROM[URLIndex]WHERE 'Search Description field sql=sql&([Description]LIKE '%&QueryWords(0)&% ' 'First Fori=LBound(QueryWords)+1toUBound(QueryWords) IfQueryWords(i)<>andUCase(QueryWords(i))<>ORandUCase(QueryWords(i))<>ANDThen IfuCase(QueryWords(i-1))=ORThen sql=sql&OR[Description]LIKE '%&QueryWords(i)&%' Else sql=sql&AND[Description]LIKE '%&QueryWords(i)&%' EndIf EndIf Next 'Search Keywords field sql=sql&)OR([Keywords]LIKE '%&QueryWords(0)&%' Fori=LBound(QueryWords)+1toUBound(QueryWords) IfQueryWords(i)<>andUCase(QueryWords(i))<>ORandUCase(QueryWords(i))<>ANDThen IfuCase(QueryWords(i-1))=ORThen sql=sql&OR[Keywords]LIKE '%&QueryWords(i)&%' Else sql=sql&AND[Keywords]LIKE '%&QueryWords(i)&%' EndIf EndIf Next 'Search for Title fields sql=sql&)OR([Title]LIKE '%&QueryWords(0)&%' Fori=LBound(QueryWords)+1toUBound(QueryWords) IfQueryWords(i)<>andUCase(QueryWords(i))<>ORandUCase(QueryWords(i))<>ANDThen IfuCase(QueryWords(i-1))=ORThen sql=sql&OR[Title]LIKE '%&QueryWords(i)&%' Else sql=sql&AND[Title]LIKE '%&QueryWords(i)&%' EndIf EndIf Next |
Share: Revealing the 17 basic typical codes of ASP programming 1. Method for ASP to obtain table input data: GETPOST 1.get: After the user adds the data to the URL, the format is "? Field 1=Input data 1 Field 2=Input data 2..., and then send it to the server. For example: action is www.abc.com, field Name input data is jack, and field age data is 15, then use the get method to http://www.abc.com?Name=jackAge=
2 pages in total Previous page 12 Next page