首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

生成HTML 分类列表页的时候,三级目录怎样是该分类的拼音,该怎么解决

2012-03-03 
生成HTML 分类列表页的时候,三级目录怎样是该分类的拼音http://localhost/flash_fl/1_1.htm这个 1_1 的意

生成HTML 分类列表页的时候,三级目录怎样是该分类的拼音
http://localhost/flash_fl/1_1.htm

这个 1_1 的意思是分类休闲的第一页

我想要生成的时候变成 http://localhost/flash_fl/xiuxian_1.htm

把 1_1 变成 xiuxian_1



下面是生成页的代码:

VBScript code
<!--#include file="conn.asp"--><html><head><meta http-equiv='Content-Type' content="text/html; charset=gb2312"><title>生成分类HTM页</title><LINK href="images/style.css" type=text/css rel=stylesheet></head><body><table width="98%" border="0" align="center" cellpadding="8" cellspacing="1" bgcolor="#7EA9DE">  <tr>    <td bgcolor="BDDFFE"><strong>生成HTML 分类列表页 </strong></td>  </tr>  <tr>    <td bgcolor="#FFFFFF"><%if request("type")<>"" then         if request("page")<>"" then           page=cint(request("page"))           D=request("D")         else                   page=1           D=timer()         end ifmpage=1mpage1=1MaxPerPage=20classid=request("classid")set rs=server.createobject("adodb.recordset")if request("type")="all" thenrs.open ("select id from class order by id desc"),conn,1,1        if not rs.eof then        rs.pagesize=1        mpage1=rs.pagecount         rs.move  (page-1)*1        do while not rs.eof        i=i+1         classid=rs("id")        if i>=1 then exit do        rs.movenext        loop        rs.close        end if        elseif request("type")="class" then        rs.open ("select id from class where id="&request("classid")&" order by id desc"),conn,1,1        if not rs.eof then        rs.pagesize=1        mpage1=rs.pagecount         rs.move  (page-1)*1        do while not rs.eof        i=i+1         classid=rs("id")        if i>=1 then exit do        rs.movenext        loop        rs.close        end if     end ifif classid<>"" thensql="select * from class where id = '"&classid&"'"rs.open sql,conn,1,1if not rs.eof thendo while not rs.eofclassid=rs("id")rs.MoveNextloopend ifrs.close     rs.open ("select * from flash where classid in("&classid&")"),conn,1,1     if not rs.eof then      rs.pagesize=MaxPerPage       mpage=rs.pagecount        else     mpage=1     end if     rs.closeend ifset rs=nothingconn.close  set conn=nothingresponse.write"<font color=""#FF0000"">"&page&"</font>/<font color=""#FF0000"">"&mpage1&"</font> 正在生成分类Html页....<span id=showImport></span><IE:Download ID=""oDownload"" STYLE=""behavior:url(#default#download)"" />"for ii=1 to mpagem=m+1response.write"<script>function onDownloadDone(downDate){showImport.innerHTML=downDate}oDownload.startDownload('make_htmlclass.asp?MaxPerPage="&MaxPerPage&"&classid="&classid&"&page="&ii&"',onDownloadDone)</script>"nextif page<mpage1 thenresponse.write"<meta http-equiv=""refresh"" content=""0;url='make_htmlclassall.asp?type="&request("type")&"&classid="&request("classid")&"&page="&page+1&"&m="&request("m")+m&"&D="&D&"'"">"elseresponse.write"<meta http-equiv=""refresh"" content=""0;url='make_htmlclassall.asp?ok="&page&"&m="&request("m")+m&"&D="&D&"'"">"end ifelse response.write"操作成功:共生成分成分类<font color=""#FF0000"">"&request("ok")&"</font> 页面<font color=""#FF0000"">"&request("m")&"</font>总费时<font color=""#FF0000"">"&FormatNumber((timer()-request("D")),2)&"</font>秒 完成时间"&Now()&""end if%></td>  </tr></table></body></html> 





表“class”如下:

id classname filename fenlei

1 休闲 xiuxian xiuxian
2 娱乐 yule yule
3 体育 tiyu tiyu
4 军事 junshi junshi



问:怎样修改代码,求高手改一下!!!十分谢谢

[解决办法]
这个很简单啊。1_1取的是id的值 ,把id值换成filename的值就ok了。

热点排行