注册 登录
编程论坛 ASP技术论坛

这个代码怎么写下去啊?高手赐教啊

aihairen 发布于 2013-08-19 13:22, 535 次点击
  
数据库名xuexi.mdb
表名: news
表字段:ID, bigclass ,smallclass ,title ,content

INDEX.ASP页面(说明:bigclass=公示栏  smallclass=通知)

读取信息代码        
   <ul>           
 <% call newsdy("通知",20,12) %>
                  
          </ul>
显示信息页面  xianshi.asp
我现在已经能实现将http://127.0.0.1/xianshi.asp?id=1120  转为http://127.0.0.1/xianshi.asp?/1120.html
但是我的主页面读取的数据记录连接还是动态的http://127.0.0.1/xianshi.asp?id=1120
怎么样将我数据的主页数据连接也显示为伪静态的http://127.0.0.1/xianshi.asp?/1120.html 请高手赐教。
             <ul>   
  <a href="xianshi.asp?/<%=rs("id")%>.html">  <% call newsdy("通知",20,12) %> </a>
         
           
          </ul>
 这样行不通,请高手指教啊
2 回复
#2
txqasp2013-08-19 15:48
最简单的方法就是http://127.0.0.1/xianshi.asp?/1120.html获取这个ID为1120的参数,传参后的页面正常ASP写法了,可以先获取当然网址,再用split将1120取出来。
#3
txqasp2013-08-19 15:50
id=Request.ServerVariables("QUERY_STRING")'取得?后的所有字符串
id=replace(id,".html","")'替换.html
if id="" then id=1
id=checkid(id)
1