1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

请问ASP问题

本帖由 阿达2006-09-05 发布。版面名称:后端开发

  1. 阿达

    阿达 New Member

    注册:
    2005-12-06
    帖子:
    54
    赞:
    0
    HTML:
     
    <!--#include file="xshlconfig.asp"-->
    <link href="xshl5_css/xshl5_css.css" rel="stylesheet" rev="stylesheet" type="text/css" media="all" />
    </head>
    <%
    xshl5_sotype=request.form("xshl5_sotype")
    if instr(xshl5_sotype,"'")<>0 or instr(xshl5_sotype,"=")<>0 or instr(xshl5_sotype,"select")<>0 then response.redirect "xshl5_error.asp"
    xshl5_sokey=request.form("xshl5_sokey")                       '获取搜索关键字
    if instr(xshl5_sokey,"'")<>0 or instr(xshl5_sokey,"=")<>0 or instr(xshl5_sokey,"select")<>0 then response.redirect "xshl5_error.asp"
    xshlmoe_tb=request.querystring("xshl5_moetype")
    if instr(xshlmoe_tb,"'")<>0 or instr(xshlmoe_tb,"=")<>0 or instr(xshlmoe_tb,"select")<>0 then response.redirect "xshl5_error.asp"
    if xshlmoe_tb="" and xshl5_sotype="" and xshl5_sokey="" then
    selectsql="select * from xshl5_moeob order by xshl5_id desc"
    elseif xshl5_sotype<>"" and xshl5_sokey<>"" then
    selectsql="select * from xshl5_moeob where "+xshl5_sotype+" like '%"+xshl5_sokey+"%'"
    elseif xshlmoe_tb<>"" then
    selectsql="select * from "+xshlmoe_tb+" order by xshl_movid desc"
    else
    response.redirect "index.asp"
    end if
    set rs=server.createobject("adodb.recordset")
    rs.open selectsql,xshlconn,1,1
    if rs.eof then
    response.write "<center><a href=index.asp>抱歉没有找到任何记录,请浏览其它项目!</a></center>"
    if xshlmoe_tb="" and xshl5_sotype="" and xshl5_sokey="" then response.end
    response.write "<meta http-equiv='refresh' content='1;url=index.asp'>"
    response.end
    end if
    rs.pagesize=index_tonum
    pagesize=rs.pagesize
    pagecount=rs.pagecount
    if not isnumeric(request.querystring("xshl_page")) and request.querystring("xshl_page")<>"" then response.redirect "xshl5_error.asp"
    if request.querystring("xshl_page")="" then
    page=1
    else
    page=int(request.querystring("xshl_page"))
    end if
    if page<=0 then page=1
    if page>pagecount then page=pagecount
    rs.absolutepage=page
    %>
    <body>
    <div id="xshl_main">
     <div id="xshl_header">
      <div id="xshl_header_main">
       <ul><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img alt="Xs5moe Version 1.05" src="xshl5_css/header1.jpg" /></li><li class="rightli"><br /><br /><br /><br />|&nbsp;&nbsp;<a title="home" href="index.asp">首页</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a title="All Movies" href="xshl5_allmov.asp">全部电影</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a title="Contact Us" href="mailto:[email protected]">联系我们</a>&nbsp;&nbsp;&nbsp;</li></ul>
      </div>
     </div>
     <div id="xshl_body">
      <div id="xshl_body_left">
       <div id="xshl_body_left_login">
        <ul><%if session("isxshl5vip")="" then%><form name="vip_userform" method="post" action="check_vipuser.asp">
         <li class="bgcolor">用户登陆</li><li>账号:&nbsp;<input class="myinput1" type="text" name="xshl5_name" value="guest" size="10" />&nbsp;密码:&nbsp;<input class="myinput1" type="password" name="xshl5_pass" value="guest" size="10" /></li><li class="myinput">&nbsp;<input class="myinput2" type="submit" name="submit" onclick="if(document.vip_userform.xshl5_name.value.length==0||document.vip_userform.xshl5_pass.value.length==0){javascript:alert('用户名或密码不能为空!');return false;}" value="确定" />&nbsp;&nbsp;&nbsp;&nbsp;<input class="myinput2" type="reset" name="reset" value="重置" />&nbsp;&nbsp;&nbsp;</li></form>
         <%else:response.write "<li class='bgcolor'>用户登陆</li><li>今天是&nbsp;"&year(date)&"年"&month(date)&"月"&day(date)&"日<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;欢迎您:"%><%if instr(session("isxshl5vip"),"xshl_vip")<>0 then%><%=replace(session("isxshl5vip"),"xshl_vip","")&"&nbsp;会员&nbsp;&nbsp;"%><%else response.write "Guest 游客&nbsp;&nbsp;":end if%><a href=logout.asp>退出</a></li><%end if%>
        </ul>
       </div>
       <div id="xshl_body_left_notice">
        <ul><li class="bgcolor">本站公告</li><li class="mytext"><marquee height="140" direction="up" scrollamount="2" onmouseover="this.stop()" onmouseout="this.start()">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;本站公告:<%=index_notice%>…</marquee></li></ul>
       </div>
       <div id="xshl_body_left_moetype">
        <ul><li class="bgcolor">影片类型</li>
    <%
    xshl5_selectsql="select * from xshlmoetb order by xshl_moetbid asc"
    set xshl5_rs=server.createobject("adodb.recordset")
    xshl5_rs.open xshl5_selectsql,xshlconn,1,1
    do while not xshl5_rs.eof
    %>
         <li class="moetype"><%if not xshl5_rs.eof then%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a title="<%=xshl5_rs("xshl_moeobname")%>" href="index.asp?xshl5_moetype=<%=xshl5_rs("xshl_tbname")%>"><%=xshl5_rs("xshl_moeobname")%></a><%xshl5_rs.movenext%><%end if%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%if not xshl5_rs.eof then%><a title="<%=xshl5_rs("xshl_moeobname")%>" href="index.asp?xshl5_moetype=<%=xshl5_rs("xshl_tbname")%>"><%=xshl5_rs("xshl_moeobname")%></a><%xshl5_rs.movenext%><%end if%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%if not xshl5_rs.eof then%><a title="<%=xshl5_rs("xshl_moeobname")%>" href="index.asp?xshl5_moetype=<%=xshl5_rs("xshl_tbname")%>"><%=xshl5_rs("xshl_moeobname")%></a><%xshl5_rs.movenext%><%end if%></li>
    <%
    loop
    xshl5_rs.close
    set xshl5_rs=nothing
    %>
        </ul>
       </div>
       <div id="xshl_body_left_moepaihang">
        <ul>
         <li class="bgcolor">影片排行榜</li>
    <%
    xshl5_soselectsql="select top 15 xshl5moe_tb,xshl5_title,xshl_num,xshl5_date from xshl5_moeob order by xshl_num desc"
    set so_rs=server.createobject("adodb.recordset")
    so_rs.open xshl5_soselectsql,xshlconn,1,1
    %>
         <li class="lipaihang1">排名</li><li class="lipaihang2">电影片名</li><li class="lipaihang3">人气</li>
    <%for i=1 to 15:if so_rs.eof then:exit for:end if%>
         <li class="lipaihang1"><%=i%></li><li class="lipaihang2"><%if session("isxshl5vip")="" then%><a title="<%=so_rs("xshl5_title")%>" href="javascript:alert('请先登陆本系统!')"><%else%><a title="<%=so_rs("xshl5_title")%>" href="xshl5_list.asp?moeob_type=<%=so_rs("xshl5moe_tb")%>&xshl5_date=<%=so_rs("xshl5_date")%>" target="_blank"><%end if%><%=so_rs("xshl5_title")%></a></li><li class="lipaihang3"><%=so_rs("xshl_num")%></li><%so_rs.movenext:next%>
        </ul>
       </div>
       <div id="xshl_body_left_sou">
        <ul><form name="xshlsoform" method="post" action="index.asp">
         <li><input type="radio" name="xshl5_sotype" value="xshl5_title" checked>片名&nbsp;<input type="radio" name="xshl5_sotype" value="mov_actor">演员&nbsp;<input type="radio" name="xshl5_sotype" value="mov_director">导演</li><li class="myinput1"><input type="text" name="xshl5_sokey" size="25" maxlength="50"></li><li><input class="myinput2" type="submit" onclick="if(document.xshlsoform.xshl5_sokey.value.length==0){javascript:alert('请输入搜索关键字!');return false;}" value="搜索">&nbsp;&nbsp;&nbsp;<input class="myinput2" type="reset" value="重置"></li></form>
        </ul>
       </div>
      </div>
      <div id="xshl_body_main">
       <div id="xshl_body_main_top">
        <ul><li class="bgcolor">&nbsp;&nbsp;推荐电影:</li><li> </li>
    <%
    gmoeselectsql="select top 10 xshl5moe_tb,xshl5_date,xshl5_title,mov_director,mov_actor,mov_date from xshl5_moeob where xshl_goodmoe='1' order by xshl5_id desc"
    set gmoe_rs=server.createobject("adodb.recordset")
    gmoe_rs.open gmoeselectsql,xshlconn,1,1
    for i=1 to index_goodmoenum
    if gmoe_rs.eof then
    exit for
    end if
    %>
         <li class="myli1">&nbsp;⊙&nbsp;片名: <a title="<%=gmoe_rs("xshl5_title")%>" <%if session("isxshl5vip")="" then%>href="javascript:alert('请先登陆本系统!')"<%else%>href="xshl5_list.asp?moeob_type=<%=gmoe_rs("xshl5moe_tb")%>&xshl5_date=<%=gmoe_rs("xshl5_date")%>" target="_blank"<%end if%>><%=left(gmoe_rs("xshl5_title"),6)%></a></li><li class="myli2">导演: <%if gmoe_rs("mov_director")="" then response.write "未知":else response.write left(gmoe_rs("mov_director"),5):end if%></li>
         <li class="myli3">主演: 
    <%
    if gmoe_rs("mov_actor")="" then
    response.write "未知"
    elseif len(gmoe_rs("mov_actor"))>=11 then
    response.write left(gmoe_rs("mov_actor"),11)&"…"
    else
    response.write gmoe_rs("mov_actor")
    end if%></li>
         <li class="myli4">添加日期: <%=gmoe_rs("mov_date")%></li>
    <%
    gmoe_rs.movenext
    next
    gmoe_rs.close
    set gmoe_rs=nothing
    %>
         <li class="myli5"> </li>
        </ul>
       </div>
       <div id="xshl_body_main_middle">
        <ul><li class="bgcolor">&nbsp;&nbsp;最新电影:</li></ul>
    <%
    for i=1 to index_tonum\4
    if rs.eof then
    exit for
    end if
    %>
        <ul>
    <%if not rs.eof then%><li class="myallmoe"><img alt="<%if xshlmoe_tb="" then response.write rs("xshl5_title"):else response.write rs("mov_title"):end if%>" width="<%=index_imawid%>" height="<%=index_imaheg%>" src="<%if xshlmoe_tb="" then response.write rs("xshl5_image"):else response.write rs("mov_image"):end if%>"><br><%if session("isxshl5vip")="" then%><a title="<%if xshlmoe_tb="" then response.write rs("xshl5_title"):else response.write rs("mov_title"):end if%>" href="javascript:alert('请先登陆本系统!')"><%else%><a href="xshl5_list.asp?moeob_type=<%if xshlmoe_tb="" then response.write rs("xshl5moe_tb"):else response.write xshlmoe_tb:end if%>&xshl5_date=<%=rs("xshl5_date")%>" target="_blank"><%end if%><%if xshlmoe_tb="" then response.write rs("xshl5_title"):else response.write rs("mov_title"):end if%></a></li><%rs.movenext%><%end if%>
    <%if not rs.eof then%><li class="myallmoe"><img alt="<%if xshlmoe_tb="" then response.write rs("xshl5_title"):else response.write rs("mov_title"):end if%>" width="<%=index_imawid%>" height="<%=index_imaheg%>" src="<%if xshlmoe_tb="" then response.write rs("xshl5_image"):else response.write rs("mov_image"):end if%>"><br><%if session("isxshl5vip")="" then%><a title="<%if xshlmoe_tb="" then response.write rs("xshl5_title"):else response.write rs("mov_title"):end if%>" href="javascript:alert('请先登陆本系统!')"><%else%><a href="xshl5_list.asp?moeob_type=<%if xshlmoe_tb="" then response.write rs("xshl5moe_tb"):else response.write xshlmoe_tb:end if%>&xshl5_date=<%=rs("xshl5_date")%>" target="_blank"><%end if%><%if xshlmoe_tb="" then response.write rs("xshl5_title"):else response.write rs("mov_title"):end if%></a></li><%rs.movenext%><%end if%>
    <%if not rs.eof then%><li class="myallmoe"><img alt="<%if xshlmoe_tb="" then response.write rs("xshl5_title"):else response.write rs("mov_title"):end if%>" width="<%=index_imawid%>" height="<%=index_imaheg%>" src="<%if xshlmoe_tb="" then response.write rs("xshl5_image"):else response.write rs("mov_image"):end if%>"><br><%if session("isxshl5vip")="" then%><a title="<%if xshlmoe_tb="" then response.write rs("xshl5_title"):else response.write rs("mov_title"):end if%>" href="javascript:alert('请先登陆本系统!')"><%else%><a href="xshl5_list.asp?moeob_type=<%if xshlmoe_tb="" then response.write rs("xshl5moe_tb"):else response.write xshlmoe_tb:end if%>&xshl5_date=<%=rs("xshl5_date")%>" target="_blank"><%end if%><%if xshlmoe_tb="" then response.write rs("xshl5_title"):else response.write rs("mov_title"):end if%></a></li><%rs.movenext%><%end if%>
    <%if not rs.eof then%><li class="myallmoe"><img alt="<%if xshlmoe_tb="" then response.write rs("xshl5_title"):else response.write rs("mov_title"):end if%>" width="<%=index_imawid%>" height="<%=index_imaheg%>" src="<%if xshlmoe_tb="" then response.write rs("xshl5_image"):else response.write rs("mov_image"):end if%>"><br><%if session("isxshl5vip")="" then%><a title="<%if xshlmoe_tb="" then response.write rs("xshl5_title"):else response.write rs("mov_title"):end if%>" href="javascript:alert('请先登陆本系统!')"><%else%><a href="xshl5_list.asp?moeob_type=<%if xshlmoe_tb="" then response.write rs("xshl5moe_tb"):else response.write xshlmoe_tb:end if%>&xshl5_date=<%=rs("xshl5_date")%>" target="_blank"><%end if%><%if xshlmoe_tb="" then response.write rs("xshl5_title"):else response.write rs("mov_title"):end if%></a></li><%rs.movenext%><%end if%>
        </ul>
    <%
    next
    %>
        <ul>
         <li class="mybottom">
    <%response.write "第"&page&"页&nbsp;"%>
    <%if page>1 then%><a title="上一页" href="index.asp?<%if xshlmoe_tb<>"" then%>xshl5_moetype=<%=xshlmoe_tb%>&<%end if%>xshl_page=<%=(page-1)%>"><%end if%><<</a>
    <%mypagecount=pagecount:if mypagecount>=10 then mypagecount=10%>
    <%for i=1 to mypagecount%>&nbsp;<a title=<%response.write "第"&i&"页"%> href="index.asp?<%if xshlmoe_tb<>"" then%>xshl5_moetype=<%=xshlmoe_tb%>&<%end if%>xshl_page=<%=i%>"><%=i%></a>&nbsp;&nbsp;<%next%>
    <%if page<pagecount then%><a title="下一页" href="index.asp?<%if xshlmoe_tb<>"" then%>xshl5_moetype=<%=xshlmoe_tb%>&<%end if%>xshl_page=<%=page+1%>"><%end if%>>></a>
    <%response.write "共"&pagecount&"页&nbsp;"%>&nbsp;|&nbsp;&nbsp;<a title="首页" href="index.asp?<%if xshlmoe_tb<>"" then%>xshl5_moetype=<%=xshlmoe_tb%>&<%end if%>xshl_page=1">首页</a>&nbsp;&nbsp;<a title="尾页" href="index.asp?<%if xshlmoe_tb<>"" then%>xshl5_moetype=<%=xshlmoe_tb%>&<%end if%>xshl_page=<%=pagecount%>">尾页</a>
         </li></ul>
       </div>
      </div>
    
      </div>
    </div>
    <%
    rs.close
    set rs=nothing
    %>
    <!--#include file=xshlconfigend.asp-->
    </body>
    </html>
    
    
    请问怎么才能一打开页面就自动提交FORM表单呀?
     
  2. 风狼

    风狼 New Member

    注册:
    2005-10-01
    帖子:
    7,452
    赞:
    25
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
    <!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>
    <%
    if request.QueryString("action")="do" Then
    response.Write Request.QueryString("qq")
    response.end()
    end if
    %>
    <body onload="form1.submit();"> '<-----这里是重点。
    <form name="form1" action="1.asp?action=do&qq=1" method="post">
    </form>

    </body>
    </html>

    希望对你有用。呼呼
     
  3. 不学无术

    不学无术 Ulysses 的元神

    注册:
    2005-08-31
    帖子:
    16,714
    赞:
    39
    郁闷,上次给你的代码你还是没有能够看懂?