<% function cutstr(tempstr,tempwid) if len(tempstr)>tempwid then cutstr=left(tempstr,tempwid)&"..." else cutstr=tempstr end if end function Function delHtml(strHtml) '做了一个函数名叫delhtml Dim objRegExp, strOutput Set objRegExp = New Regexp ' 建立正则表达式 objRegExp.IgnoreCase = True ' 设置是否区分大小写 objRegExp.Global = True '是匹配所有字符串还是只是第一个 objRegExp.Pattern = "(<[a-zA-Z].*?>)|(<[\/][a-zA-Z].*?>)" ' 设置模式引号中的是正则表达式,用来找出html标签 strOutput = objRegExp.Replace(strHtml, "") '将html标签去掉 strOutput = Replace(strOutput, "<", "<") '防止非html标签不显示 strOutput = Replace(strOutput, ">", ">") delHtml = strOutput Set objRegExp = Nothing End Function %> <!--#include file="title.asp"--> <%Title=Trim(request("Title")) Set rs = Server.CreateObject("ADODB.Recordset") sql="select Content from Aboutus where Title='"&Title&"'" rs.open sql,conn,1,3 %>
<%=rs("Content")%>