查看: 3845|回复: 5

[问与答] asp从数据库读出的路径含有其它字符怎么去掉呢?

[复制链接]
小菜鸟 发表于 2015-1-29 15:26:46 | 显示全部楼层 |阅读模式
asp从数据库读出的路径含有[UPLOAD]upfile/0001.pdf[/UPLOAD],我只要upfile/0001.pdf,怎么去掉呢?                                   <select name="selectsd">
                                 <%set rs=conn.execute("select * from news where BigClassName='"& guidepost &"' order by ID desc")
                                  if rs.recordcount=0 then%>
                                  <option selected value="">无记录</option>
                                  <%else%>
                                  <option selected value="">请选择</option>
                                  <%do while not rs.eof%>
                                  <option value="<%=rs("content")%>"><%=rs("title")%></option>
                                  <%rs.movenext
                                  loop
                                  end if%>
                                 </select>
                                  期刊
                               <script type="text/javascript">   
                                function Down(path){
                                 location.reload(path);
                               }   
                                </script>
ttasp 发表于 2015-1-29 15:47:19 | 显示全部楼层
本帖最后由 ttasp 于 2015-1-29 15:49 编辑
asp从数据库读出的路径含有upfile/0001.pdf[/UPLOAD],我只要upfile/0001.pdf,怎么去掉呢?                ...
小菜鸟 发表于 2015-1-29 15:26




  1. <select name="selectsd">
  2. <%
  3. set rs=conn.execute("select * from news where BigClassName='"& guidepost &"' order by ID desc")
  4. if rs.recordcount=0 then                                                                  
  5.         %>
  6.         <option selected value="">无记录</option>
  7.         <%else%>
  8.         <option selected value="">请选择</option>
  9.         <%
  10.         do while not rs.eof                                                               
  11.         ct=rs("content")
  12.         ct=replace(ct,"[UPLOAD]","")
  13.         ct=replace(ct,"[/UPLOAD]","")
  14.         %>
  15.         %>
  16.         <option value="<%=ct%>"><%=rs("title")%></option>
  17.         <%
  18.         rs.movenext
  19.         loop
  20.         end if
  21.         %>
  22. </select>
  23. 期刊
  24. <script type="text/javascript">   
  25. function Down(path){
  26. location.reload(path);
  27. }   
  28. </script>
复制代码


不知道是不是这意思
 楼主| 小菜鸟 发表于 2015-1-29 16:04:13 | 显示全部楼层
回复 2# ttasp


    [upload=pdf]uploadfiles/001.pdf[/upload]返回值是这样的,想去掉[upload=pdf]和[/upload]
ttasp 发表于 2015-1-29 16:09:11 | 显示全部楼层
本帖最后由 ttasp 于 2015-1-29 16:10 编辑
回复  ttasp


    uploadfiles/001.pdf[/upload]返回值是这样的,想去掉和[/upload]
小菜鸟 发表于 2015-1-29 16:04


<select name="selectsd">
<%
set rs=conn.execute("select * from news where BigClassName='"& guidepost &"' order by ID desc")
if rs.recordcount=0 then                                                                  
        %>
        <option selected value="">无记录</option>
        <%else%>
        <option selected value="">请选择</option>
        <%
        do while not rs.eof                                                               
        ct=rs("content")
        ct=replace(ct,"[upload=pdf]","")
        ct=replace(ct,"[/upload]","")
        %>
        %>
        <option value="<%=ct%>"><%=rs("title")%></option>
        <%
        rs.movenext
        loop
        end if
        %>
</select>
期刊
<script type="text/javascript">   
function Down(path){
location.reload(path);
}   
</script>
重点在红色部分,你注意下大小写
 楼主| 小菜鸟 发表于 2015-1-29 16:23:51 | 显示全部楼层
OK了,谢谢!
ttasp 发表于 2015-1-29 16:25:29 | 显示全部楼层
OK了,谢谢!
小菜鸟 发表于 2015-1-29 16:23



   欢迎常来
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表

在线客服

售前咨询
售后咨询
服务热线
023-58418553
微信公众号