asp 伪静态问题...求解
在网上找了一个关于伪静态的例子,根据说明也创建了相应的文件和文件夹。
效果也能实现如:new.asp?id=1 转换URL后的效果就是 new/?1.html 问题是能否把 ?号 去掉,直接变成 new/1.html 各种求解???
附上我的文件:index.asp、index.asp(在new文件下创建的)
数据库表名:xwgg 字段包括:id、title
index.asp
<!--#include file="Conn_1.asp"--><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title></head><body><form name="form" action="" method="post"><%Dim I set rs=Server.CreateObject("adodb.recordset") sql = "select * from xwgg order by shijian desc" rs.open sql,conn,1,1 If Not rs.Bof And Not rs.Eof Then I=rs.PageSize Do While Not rs.Eof And I>0 I=I-1 %> <a href="new/?<%=rs("id")%>.html"><%=rs("title")%></a></td><% rs.movenext loop end if%> </form></body></html><!--#include file="../Conn_1.asp"--><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title></head><%Dim value1,value2,id1,id2,id,todayvalue1=replace(Request.ServerVariables("QUERY_STRING"),".html","") '获得?后面的参数value2=split(value1,"-") '对参数进行过滤,从而获得id1和id2的值id1=value2(0)id2=value2(1)set xwgg=Server.CreateObject("adodb.recordset")xwgg_sql = "select * from xwgg where id="&id1xwgg.open xwgg_sql,conn,1,3%><body><form action="" method="post"><table width="650" height="39" border="0" cellpadding="0" cellspacing="0" style=" border-bottom:1px dashed #333333;"> <tr> <td align="center" valign="middle" class="zi06">标题:<%=xwgg("title")%></td> </tr> <tr> <td align="center" valign="middle" class="zi06">内容:</td> </tr></table></form></body></html>