推薦:解析ASP檢查網站鏈接是否正常的函數% FunctionurlChk(sUrl) onerrorresumenext SetxmlHttp=Server.CreateObject(Microsoft.XMLHTTP) xmlHttp.openGET,sUrl,false xmlHttp.send ifxmlHttp.Status200then urlChk=false else urlChk=true endif EndFunction sUrl=http://www.code-123.com ifu
用ASP實現搜索引擎的功能是一件很方便的事,可是,如何實現類似3721的智能搜索呢?比如,當在搜索條件框內輸入“中國人民”時,自動從中提取“中國”、“人民”等關鍵字并在數據庫內進行搜索??赐瓯疚暮?,你就可以發現,這個功能實現起來竟然是如此的簡單。 <!-- Search.asp --> <form name="frm_Search" method="get" action="Search.asp"> 請輸入關鍵字: <input type="text" name="key" size="10"> <input type="submit" value="搜索"> </form> |
<% Dim strProvider,CNN strProvider="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" strProvider=strProvider & Server.MapPath("/") & "/data/db_Sample.mdb" ’假設數據庫存放在主頁根目錄下的data目錄下 Set CNN = Server.CreateObject("ADODB.connection") CNN.Open strProvider 打開數據庫連接 %> |
<font color="#FF0000">未找到任何結果!??!</font> <% Else %> |
<% While Not RST.EOF 遍歷整個記錄集,顯示搜索到的信息并設置鏈接 %> <!-- 此處可設為你所需要的鏈接目標 --> <font style="font: 12pt 宋體"><a href="info.asp?ID=<%= RST("ID") %>" target="_blank"><%= RST("U_Name") %></a></font> <!-- 顯示部分詳細內容 --> <font style="font: 9pt 宋體"><%= Left(RST("U_Info"),150) %></font><p> <% RST.MoveNext Wend RST.Close Set RST=Nothing End If End If %> |
分享:ASP教程之asp制作常見flash新聞圖片輪換代碼這是一個正常的網頁文件 html head metahttp-equiv=Content-Typecontent=text/html;charset=gb2312/ title 新聞圖片輪換 /title /head body !--#Includefile=diaoyong.asp-- /body /html 任何網頁只要調用下面這個文件(diaoyong.asp)就可以了,所用f
新聞熱點
疑難解答