下拉框问题,看过来!!!(50分)

  • 主题发起人 xiaodaihehehe
  • 开始时间
asp文件的源码如下:
<%@ LANGUAGE="VBSCRIPT" %>
<% option explicit %>
<%response.buffer=false
%>
<!--#include file="majunconn.asp"-->
<!--#include file="checkinfo.asp" -->
<html>
<head>
<title>反恐论坛</title>
<META content="text/html;
charset=gb2312" http-equiv=Content-Type>
<SCRIPT>function HighlightAll(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
therange=tempval.createTextRange()
therange.execCommand("Copy")}

function enable(btn){
btn.filters.gray.enabled=0;}
function disable(btn){
btn.filters.gray.enabled=1;}
</SCRIPT>
<STYLE>.gray {
CURSOR: hand;
FILTER: gray
}
</STYLE>
<STYLE type=text/css>P {
COLOR: #333333;
FONT-FAMILY: 宋体;
FONT-SIZE: 9pt
}
INPUT {
COLOR: #333333;
FONT-FAMILY: 宋体;
FONT-SIZE: 9pt
}
SELECT {
COLOR: #333333;
FONT-FAMILY: 宋体;
FONT-SIZE: 9pt
}
TABLE {
BORDER-BOTTOM: 2px;
BORDER-LEFT: 0px;
BORDER-TOP: 1px
}
TD {
BORDER-RIGHT: 1px;
BORDER-TOP: 1px;
COLOR: #000000;
FONT-FAMILY: 宋体;
FONT-SIZE: 9pt
}
TD {
WORD-BREAK: break-all
}
A {
TEXT-DECORATION: none
}
A:hover {
COLOR: #0066cc;
TEXT-DECORATION: underline
}
BODY {
FONT-FAMILY: 宋体
COLOR: #CCAAAA;
FONT-SIZE: 9pt
}
TEXTAREA {
FONT-FAMILY: 宋体;
FONT-SIZE: 9pt
}
.menu {
BACKGROUND-COLOR: #fefeff;
BORDER-BOTTOM: #500000 1px;
BORDER-LEFT: #500000 1px;
BORDER-RIGHT: #500000 1px;
BORDER-TOP: #500000 1px;
FILTER: revealTrans(transition=23,duration=0.5) blendTrans(duration=0.5);
HEIGHT: 20px;
POSITION: absolute;
VISIBILITY: hidden;
Z-INDEX: 1;
layer-background-color: #FEFEFF
}
.title {

}
.cau {

}
.bot {
BORDER-BOTTOM: medium none;
BORDER-LEFT: rgb(0,0,0) 1px solid;
BORDER-RIGHT: rgb(0,0,0) 1px solid;
BORDER-TOP: rgb(0,0,0) 1px solid
}
.bot2 {
BORDER-BOTTOM: #000000 1px solid;
BORDER-LEFT: #000000 1px solid;
BORDER-RIGHT: #000000 1px solid;
BORDER-TOP: black 0px solid
}
.bot4 {
BORDER-BOTTOM: #000000 1px solid;
BORDER-LEFT: #000000 1px solid;
BORDER-RIGHT: #000000 1px solid;
BORDER-TOP: #000000 1px solid
}
.bot3 {
BORDER-BOTTOM-COLOR: black;
BORDER-BOTTOM-STYLE: solid;
BORDER-LEFT: #000000 1px solid;
BORDER-RIGHT: #000000 1px solid;
BORDER-TOP: #000000 1px solid
}
</STYLE>
<SCRIPT language="javascript">
<!--
function check()
{
var len1=comeform.username.value.length;
var len2=comeform.password.value.length;

if (len1==0)
{
alert("请输入您想注册的队员名称!");
comeform.username.focus();
return false;
}
else

if (comeform.username.value.indexOf(" ")!=-1)
{
alert("队员名称不能含有空格!");
comeform.username.focus();
return false;
}
else

if (len2==0)
{
alert("请您输入您的队员密码!");
comeform.password.focus();
return false;
}
else

if (comeform.password.value.indexOf(" ")!=-1)
{
alert("队员密码中不能含有空格!");
comeform.password.focus();
return false;
}
else
return true;
}
// -->
</SCRIPT>
<META content="MSHTML 5.00.2920.0" name=GENERATOR></HEAD>
<BODY aLink=#333333 background="流星之梦 Delphi技术2.files/bmb.htm" bgColor=#ffffff
leftMargin=0 link=#333333 topMargin=3 vLink=#333333>
<STYLE>BODY {
SCROLLBAR-FACE-COLOR: 99ccff;
SCROLLBAR-HIGHLIGHT-COLOR: C6DE92;
SCROLLBAR-SHADOW-COLOR: #FFFFFF;
SCROLLBAR-3DLIGHT-COLOR: #FFFFFF;
SCROLLBAR-ARROW-COLOR: #000000;
SCROLLBAR-TRACK-COLOR: #FFFFFF;
SCROLLBAR-DARKSHADOW-COLOR: #FFFFFF
}
</STYLE></head>
<%
dim sql
dim sql2
dim rs3
dim rs
dim rs2
dim total
dim total2
dim str
dim order

order=request.form("sel")


set rs=server.createobject("adodb.recordset")
set rs2=server.createobject("adodb.recordset")
set rs3=server.createobject("adodb.recordset")
sql="select * from newsinfo order by "&amp;
order &amp;" desc"

rs.open sql,conn,3,3
rs2.open "select * from userinfo ",conn,1,1
rs3.open "select * from repinfo ",conn,1,1
total=rs.recordcount+rs3.recordcount

%>
<body>
<center> <center>
<form method="post" name="comeform" onSubmit="return(check());" action="comein.asp">
<Table width="98%" border="0" cellpadding="0" cellspacing="0" bordercolor="#0099FF">
<tbody>
<tr>
<td width="83%" height="43" align="left"> <div align="left"><img src="IMAGES/bbs.gif" width="170" height="71">
</div>

</TD>
<td width="17%" align="left"><img src="IMAGES/awp%20.jpg" width="150" height="50"></TD>
</tr>
<tr>
<td height="19" colspan="2" align="left"><hr align="center" width=97% size=1 color="#0094DB"></TD>
</tr>
</tbody>
</Table>

<table width="98%" border="0" cellpadding="0" cellspacing="0" >
<tbody>
<tr align="left" >
<td> <div align="left">
<table width="94%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="8%" height="18">&amp;nbsp;</td>
<td width="92%" valign=middle><marquee loop="-1" scrolldelay=150>
<img src="IMAGES/gg.gif" width="14" height="14"> 您是我们的第<strong><font color=red><%= Counts("Counter.txt") %>
</font></strong>位访客&amp;nbsp;&amp;nbsp;,欢迎光临反恐论坛![<%=now()%>]
</marquee></td>
<td></td>
</tr>
</table>
</div></td>
</tr>
<tr align="left" valign="bottom">
<td height="50" colspan="3">
<table width="100%" border="1" align=center cellpadding="0" cellspacing="0" bordercolor="#009AFF">
<tr align=left valign="top" >
<td height="22" colspan="4" background="IMAGES/tablebg.gif"><img alt=更多公告 border=0 src="images/gb.gif" width=18>
&amp;nbsp;<strong>论坛信息</strong></td>
</tr>
<tr>
<td width="24%" height="100" align="right" valign="middle">
<table width="93%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="20">论坛成立时间:2003年6月26日</td>
</tr>
<tr>
<td height="20">共有注册会员:<strong><font color="#FF0000"><%=rs2.recordcount%></font></strong></td>
</tr>
<tr>
<td height="20">主题总数:<font color="#FF0000"><strong><%=rs.recordcount%></strong></font>
</td>
</tr>
<tr>
<td height="20">貼子总数:<font color="#FF0000"><strong><%=total%></strong></font></td>
</tr>
<tr>
<td height="20">欢迎大家成为<font color="#FF0000"><strong>CS</strong></font>会员</td>
</tr>
</table></td>
<td width="30%" align=center valign="middle">

<%
if session("zkuser")<>"" then
%>
<table width="87%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="16" align="center"></td>
</tr>
<tr>
<td height="9" align="center"><strong><font color="#FF0000"><%=Trim(session("zkuser"))%></font></strong><font color="#FF0000"><font color="#000000">
会员您好,欢迎您登陆反恐论坛!</font></font></td>
</tr>
<tr>
<td height="8"></td>
</tr>
<tr>
<td height="29" align="center"><a href="edituser.asp" target="_blank"><img src="IMAGES/usereidt.gif" width="70" height="20" border="0"></a>
&amp;nbsp;<a href="newspost.asp" target="_blank"><img src="IMAGES/newnews.gif" width="70" height="20" border="0"></a>
</td>
</tr>
<tr>
<td height="23" align="center"><a href="upimg.asp" target="_blank"><img src="IMAGES/newnews.gif" border="0"></a>
&amp;nbsp;<a href="showimglist.ASP" target="_blank"><img src="IMAGES/newnews.gif" border="0"></a></td>
</tr>
<tr>
<td height="6" ></td>
</tr>
</table>
<%
else
%><br>
<table width="68%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="18"><strong><font color="#FF0000" size="3">==></font>快速登陆入口:</strong></td>
</tr>
<tr>
<td height="21" align="center"> <p>会员名称:
<input type=text size=9 name="username" >
<br>
</p></td>
</tr>
<tr>
<td height="18" align="center">登陆密码:
<input type=password size=9 name="password"> </td>
</tr>
<tr>
<td align="center"> <input type="submit" value="登 陆" class="buttonface" name="cmdOk2">
&amp;nbsp;
<input type="button" value="注 册" class="buttonface" name="cmdOk" onClick="location.href='userpost.asp'">
</td>
</tr>
</table>
<%
end if
%>
</td>
<td width="25%" align="center" valign="middle">
<table width="94%" border="0" cellpadding="0" cellspacing="0">
<tr align="center">
<td height="21" colspan="2"><font color="#FF0000"><strong><font color="#000000">人气</font>最旺<font color="#000000">文章TOP5</font></strong></font></td>
</tr>
<%
dim rstop5
dim newsname
dim newsname5
dim rsscoretop5

set rstop5=server.createobject("adodb.recordset")
set rsscoretop5=server.createobject("adodb.recordset")
rstop5.open "select top 5 * from newsinfo order by watchtimes desc",conn,1,1
rsscoretop5.open "select top 5 * from userinfo order by score desc",conn,1,1

do while not rstop5.eof
newsname=rstop5("title")
newsname5=mid(newsname,1,8)%>
<tr>
<td width="77%" align="left" hignt="22"><a href="onenews.asp?title1=<%=rstop5("title")%>" target="_blank"><%=newsname5%></a></td>
<td width="23%"><%=rstop5("watchtimes")%></td>
</tr>
<% rstop5.movenext
loop
%>
</table>
<%
rstop5.close
set rstop5=nothing
%>
</td>
<td width="21%" align="center" valign="middle">
<table width="86%" border="0" cellpadding="0" cellspacing="0">
<tr align="left">
<td height="21" colspan="2"><div align="center"><font color="#FF0000"><strong><font color="#000000">积分</font>最高<font color="#000000">会员top5</font></strong></font></div></td>
</tr>
<%do
while not rsscoretop5.eof

%>
<tr>
<td align="left" hignt="22"><a href="userinfo.asp?userinfo=<%=rsscoretop5("username")%>" target="_blank"><%=rsscoretop5("username")%></a></td>
<td width="25%"><%=rsscoretop5("score")%></td>
</tr>
<% rsscoretop5.movenext
loop
%>
</table>
<%
rsscoretop5.close
set rsscoretop5=nothing
%>
</td>
</tr>
</table></td>
</tr>
<tr>
<td width="68%" height="24" align="center">
<div align="left"><strong>*
您的位置&amp;lt;&amp;lt;论坛主页</strong> </div></td>
<td width="24%" align="center">
<select name="orderby" >
<option value="replasttime" >按回复时间 </option>
<option value="time">按发贴时间</option>
</select ></td>
<td width="8%" align="center"><input type="button" name="sel" value="Go" onClick="location.href='0.asp'"></td>
</tr>
</tbody>
</table></form>
<%

Function Counts(CounterFile)
Dim objFSO, objTS
Application.Lock '锁定Application对象
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTS = objFSO.OpenTextFile(Server.MapPath(CounterFile), 1, True)
If Not objTS.AtEndOfStream then
'检查是否到达文件结尾
Counts = CLng(objTS.ReadLine)
End If
Counts = Counts + 1
objTS.Close

Set objTS = objFSO.OpenTextFile(Server.MapPath(CounterFile), 2, True)
objTS.WriteLine(Counts)
objTS.Close
Application.Unlock '解除锁定
End Function
%>
<%
const MaxPerPage=30 '分页显示的纪录个数
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim pass
dim titlel

pass=request("pass")

if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
if rs.eof and rs.bof then
response.write "<p align='center'> 还 没 有 任 何 留 言</p>"
else
totalPut=rs.recordcount
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut / MaxPerPage
else
currentpage= totalPut / MaxPerPage + 1
end if
end if
if currentPage=1 then
showpages
showContent
showpages
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpages
showContent
showpages
else
currentPage=1
showContent
end if
end if
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
sub showContent %>
<div align="center">

</div>
<table align=center width="98%" border="1" cellpadding="0" cellspacing="0" bordercolor="#0099FF" background="IMAGES/header_tile.gif" bgcolor="#f2f8ff" >
<tbody>
<tr align=middle >
<td width=* height="22" align="center" valign="bottom" ><font size="2"><strong>主题</strong></font></td>
<td width=100 align="center" valign="bottom" ><font size="2"><strong>作者</strong></font></td>
<td width=120 align="center" valign="bottom" ><font size="2"><strong>发帖时间</strong></font></td>
<td width=70 align="center" valign="bottom"><strong><font size="2">回复/人气</font></strong></td>

<td width=185 align="center" valign="bottom"><font size="2"><strong>最后回复</strong></font></td>
</tr>
</tbody>
</table>

<%

dim i
i=0
do while not (rs.eof or err)
%>
<table align=center width="98%" border="1" cellpadding="0" cellspacing="0" bordercolor="#009AFF">
<tbody>
<tr align=middle height="26">

<td width=32 bgcolor="#f2f8ff"><img src="<%=rs("motion")%>" width="20" height="20">
</td>
<td onmouseout="javascript:this.bgColor='f2f8ff'"
onmouseover="javascript:this.bgColor='ffffff'" width=*><font size="2">
<table width="100%" border="0" cellpadding="5" cellspacing="0" wid>
<tbody>
<tr>
<td ><a href="onenews.asp?title1=<%=rs("title")%>" target="_blank"><strong><%=rs("title")%></strong></a>
</td>
</tr>
</tbody>
</table>
</td>
<td width=100 ><p><font color="#000000"><a href="userinfo.asp?userinfo=<%=rs("name")%>" target="_blank"><%=rs("name")%> </a></font>
</p></td>

<td width=120 bgcolor="#f2f8ff" ><font color="#000000" ><%=rs("time")%></font></td>
<td width=70><font color="#000000"><%=rs("reptimes")%>/<%=rs("watchtimes")%></font></td>

<td width=185 bgcolor="#f2f8ff" ><div align="left"><font color="#000000">&amp;nbsp;&amp;nbsp;<%=rs("replasttime")%><font color="#FF0000"><strong>|</strong></font><%=rs("replastname")%></font></div></td>
</tr>
<%
i=i+1
if i>=MaxPerPage then
exitdo
rs.movenext
loop %>
</tbody>
</table>
<%end sub %>
<table border="0" cellpadding="0" cellspacing="0" width="80%" height="28" >
<tr>

<td height="28"><center>
<div align="center">
<% sub showpages()
dim n
if (totalPut mod MaxPerPage)=0 then
n= totalPut / MaxPerPage
else
n= totalPut / MaxPerPage + 1
end if
if n=1 then

response.write " &amp;nbsp;&amp;nbsp;"
'response.write "</p>"
exit sub
end if
dim k
response.write "<p align='left'><strong><font color=#009AFF>&amp;nbsp;&amp;nbsp;留言分页</font><strong>"
for k=1 to n
if k=currentPage then
response.write "<b>"+Cstr(k)+"</b> "
else
response.write "<b>"+"<a href='0.asp?page="+cstr(k)+"'>"+Cstr(k)+"</a></b> "
end if
next
'response.write "&amp;nbsp;&amp;nbsp;<a href=newspost.asp ><img src=images/newnews.gif border=0></a>"
'response.write "</p>"
end sub
%>
</div></td></tr>
</table>

<%
'关闭数据库连接并释放对象
rs.Close
rs2.close
rs3.close
Set rs = Nothing
Set rs2 = Nothing
Set rs3 = Nothing
'reprs.Close
'Set reprs = Nothing
Conn.Close
Set Conn = Nothing
%></div>
<TABLE border=0
cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD width="100%" height="89" align=middle> <p align="center">本论坛言论纯属发表者个人意见,与
<FONT
color=#990000><b>反恐论坛</b></FONT>立场无关<br>
版权所有:<font color="#000000">&amp;copy;
</font>xiaodaihehe<br>
本论坛所有文字版权归作者所有 未经许可严禁转载<BR>
</p></TD>
<TD align=right>&amp;nbsp;</TD>
</TR>
</TBODY>
</TABLE>
</body>
</html>
 
<!-- #include file="../../include/bkconn.asp "-->
<!--#include file="../checkUser.asp"-->
<%call checkRight(session("userID"),"r7")%>
<%
dim rs,sql
dim page,maxPerPage
maxPerPage=10 '每页显示的记录数
page=Request("page")

if (page="" or isempty(page)) then
page=1
thisUrl="../order/orderList.asp?true=1"
session("adminOldUrl")=thisUrl&amp;"&amp;page="&amp;page
set rs=server.createobject("adodb.recordset")
sql="SELECT orders.*, member.USEType FROM orders, member WHERE orders.memberid = member.memberid"

if request.form("searchFlag")="true" then
'需要查询
bTime =request.form("byear")+"-"+request.form("bmonth")+"-"+request.form("bdate")+" 23:59:59"
eTime =request.form("eyear")+"-"+request.form("emonth")+"-"+request.form("edate")+" 23:59:59"
if isdate(btime) and isdate(etime) then

Select case request.form("dateType")
case "1" sql=sql&amp;" and createDate>='" &amp;btime &amp;
"' and CreateDate <='" &amp;eTime &amp;"'"
case "2" sql=sql&amp;" and PayDate>='" &amp;btime &amp;
"' and PayDate <='" &amp;eTime &amp;"'"
case "3" sql=sql&amp;" and GoodsDate>='" &amp;btime &amp;
"' and GoodsDate <='" &amp;eTime &amp;"'"
case else
sql=sql&amp;" and createDate>='" &amp;btime &amp;
"' and CreateDate <='" &amp;eTime &amp;"'"
end Select
end if
if request.form("UseType")<>"-1" then
sql=sql &amp;
" and UseType=" &amp;
request.form("UseType")
if request.form("memberName")<>"" then
sql=sql &amp;
" and orders.CustomerName like '%" &amp;
request.form("memberName") &amp;
"%'"
if request.form("PayState")<>"-1" then
sql=sql &amp;
" and payState=" &amp;
request.form("PayState")
if request.form("GoodsState")<>"-1" then
sql=sql &amp;
" and GoodsState=" &amp;
request.form("GoodsState")
end if

sql=sql&amp;" order by orders.id desc"
rs.open sql,conn,1,1
rs.pagesize=MaxPerPage
%>
<html>
<head>
<title>订单维护</title>
<meta http-equiv="Content-Type" content="text/html;
charset=gb2312">
<link rel="stylesheet" href="../main.css" type="text/css">
<script language=Javascript>
<!--
function jumpTo(i){
if(i==1){
this.document.location="<%=thisUrl%>";}
if(i==2){
this.document.location="<%=thisUrl%>&amp;page=<%=page-1%>";}
if(i==3){
this.document.location="<%=thisUrl%>&amp;page=<%=page+1%>";}
if(i==4){
this.document.location="<%=thisUrl%>&amp;page=<%=rs.pageCount%>";}
}
//-->
</script>
</head>
<body bgcolor="#9CC7EF" text="#000000" leftmargin="0" topmargin="0">
<div align="center"><br>
<font size="5" face="隶书">订单维护</font> <br>
</div>
<table width="98%" border="1" bordercolordark=#9CC7EF bordercolorlight=#145AA0 cellspacing="0" cellpadding="4" align="center">
<tr bgcolor="#4296E7">
<form method="post" action="orderList.asp" name="frmOrdList">
<td colspan="7" height="28">
<input type="hidden" name="searchFlag" value="true">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">开始日期:</td>
<td align="left">
<input name="bYear" type="text" id="bYear" size="4" maxlength="4">
- <input name="bMonth" type="text" id="bMonth" size="2" maxlength="2">
- <input name="bDate" type="text" id="bDate" size="2" maxlength="2"></td>
<td align="center">截至日期:</td>
<td align="left">
<input name="eYear" type="text" id="eYear" size="4" maxlength="4">
- <input name="eMonth" type="text" id="eMonth" size="2" maxlength="2">
- <input name="eDate" type="text" id="eDate" size="2" maxlength="2"></td>
<td align="right">收款状态:</td>
<td>
<select name="PayState" id="PayState" style="width=70px">
<option value="-1">不选择</option>
<%set RsState=server.createobject("adodb.recordset")
sql="select id,name from StateInfo where type=1"
RsState.open sql,conn,1,1
while not (RsState.eof or RsState.bof)
if RsState("id")=PayState then

response.write "<option value="&amp;RsState("id")&amp;" selected>"&amp;RsState("Name")&amp;"</option>"
else
response.write "<option value="&amp;RsState("id")&amp;">"&amp;RsState("Name")&amp;"</option>"
end if
RsState.movenext
wend
RsState.close
set RsState=nothing
%>
</select></td>
<td align="center">用户类型:</td>
<td align="left">
<select name="UseType" id="UseType">
<option value="-1" selected>不选择</option>
<option value="1">经销商</option>
<option value="0">散户</option>
</select></td>
<td colspan="2" rowspan="2" align="center">
<input type="submit" name="Submit" value="查询"></td>
</tr>
<tr>
<td align="center">日期描叙:</td>
<td colspan="3" align="left"><input type="radio" value="1" name="dateType" checked>
订购日期
<input type="radio" value="2" name="dateType">
收款日期
<input type="radio" value="3" name="dateType">
发货日期</td>
<td align="right">货物状态:</td>
<td><select name="GoodsState" id="GoodsState" style="width=70px">
<option value="-1">不选择</option>
<%set RsState=server.createobject("adodb.recordset")
sql="select id,name from StateInfo where type=2"
RsState.open sql,conn,1,1
while not (RsState.eof or RsState.bof)
if RsState("id")=GoodsState then

response.write "<option value="&amp;RsState("id")&amp;" selected>"&amp;RsState("Name")&amp;"</option>"
else
response.write "<option value="&amp;RsState("id")&amp;">"&amp;RsState("Name")&amp;"</option>"
end if

RsState.movenext
wend
RsState.close
set RsState=nothing
%>
</select></td>
<td align="center">用户名称:</td>
<td align="center">
<input name="memberName" type="text" id="memberName" size="10" maxlength="10"></td>
</tr>
</table>
</td>
</form>
</tr>
<tr bgcolor="#5EA5E6">
<td width="6%" nowrap>
<div align="center"><font color="#FFFFFF"> 编号</font></div>
</td>
<td width="8%" nowrap>
<div align="center"><font color="#FFFFFF">客户帐号</font></div>
</td>
<td width="7%" nowrap>
<div align="center"><font color="#FFFFFF">客户姓名</font></div>
</td>
<td width="50%" nowrap>
<div align="center"><font color="#FFFFFF">地址</font></div>
</td>
<td width="12%" nowrap>
<div align="center"><font color="#FFFFFF">电话</font></div>
</td>
<td width="12%" nowrap>
<div align="center"><font color="#FFFFFF">Email</font></div>
</td>
<td width="5%" nowrap>
<div align="center"><font color="#FFFFFF">详细</font></div>
</td>
</tr>
<%
dim rsID
i=1
if not (rs.eof or err) then
rs.move (page-1)*maxPerPage
do while not (rs.eof or err)
rsID=rs("id")
%>
<tr>
<td width="6%">
<div align="center"><%=rs("id")%></div>
</td>
<%if rs("memberID")<>"非会员" then
%>
<td width="8%" title="点击查看会员信息" style="cursor:hand" onClick="Javascript:window.location='../member/memberMod.asp?memberID=<%=rs("memberID")%>'" bgcolor="#0099FF" nowrap><%=rs("memberID")%>&amp;nbsp;</td>
<%else
%>
<td width="8%">非会员</td>
<%end if %>
<td width="7%" nowrap><%=rs("customerName")%></td>
<td width="50%"><%=rs("address")%></td>
<td width="12%" nowrap><%=rs("phone")%></td>
<td width="12%" nowrap><%=rs("email")%></td>
<td width="5%" title="点击查看订单具体信息" style="cursor:hand" onClick="Javascript:window.location='orderMod.asp?id=<%=rs("id")%>'" bgcolor="#009999" nowrap>处理</td>
</tr>
<%
i=i+1
if i>maxPerPage then
exitdo
rs.moveNext
loop
%>
<tr bgcolor="#4296E7">
<td colspan="7">
<div align="right"><font color=#FFFFFF><%=rs.recordCount%> 项 第<%=page%>/<%=rs.pageCount%>
页 </font>
<%if page>1 then
%>
<input type="button" name="Submit3" value="首页" onClick="Javascript:jumpTo(1)">
<input type="submit" name="Submit4" value="上页" onClick="Javascript:jumpTo(2)">
<%else
%>
<input type="button" name="Submit3" value="首页" disabled>
<input type="submit" name="Submit4" value="上页" disabled>
<%end if
if rs.recordCount>page*maxPerPage then
%>
<input type="submit" name="Submit5" value="下页" onClick="Javascript:jumpTo(3)">
<input type="submit" name="Submit6" value="末页" onClick="Javascript:jumpTo(4)">
<%else
%>
<input type="submit" name="Submit5" value="下页" disabled>
<input type="submit" name="Submit6" value="末页" disabled>
<%end if%>
</div>
</td>
</tr>
</table>
<script language="javascript">
<!--
var today=new Date();
do
cument.frmOrdList.bYear.value =today.getYear()-1;
do
cument.frmOrdList.bMonth.value =today.getMonth()+1;
do
cument.frmOrdList.bDate.value =today.getDate();

do
cument.frmOrdList.eYear.value =today.getYear();
do
cument.frmOrdList.eMonth.value =today.getMonth()+1;
do
cument.frmOrdList.eDate.value =today.getDate();

-->
</script>
</body>
</html>
看看我写的这段代码吧
1.首先页面中有个Form,其action为指向本页面
2. if request.form("searchFlag")="true" then
'需要查询
判断searchFlag来增加条件
3.执行查询条件
 
1。<!--input type="button" name="sel" value="Go" onClick="location.href='0.asp'"此按钮为链接,并非提交-->
改为 <input name="" type="submit" value="GO">
2.可以把sele单独列出一个别form提交地址为本页,
3。name名是否相对应
order=request.form("sel")改为order=request.form("orderby")
orderby为select名 <select name="orderby" >
 
to 石子儿:
1.问题一:
如你所述,终于可以选择排序了:),可是由于order没有初始值,页面刚刚出现时没有录只有选择排序之后才出现记录,我在option后加个selected:<option value="time" selected>按发贴时间</option>也不行,selected不是默认值吗
2.问题二:
当我登录之后再点击go button,却显示错误提示:“comeform.username.value”为空或不存在
 
1.在order=request.form("orderby")后加一个判断
if order="" then
order="time"
end if
这个才是默认“time”或“replasttime”
2。看你的代码除了<!--#include file="majunconn.asp"-->
<!--#include file="checkinfo.asp" -->里不知道以外,
有comform.username的只有function check(),而能调用check的只有comform的onsubmit,
应该与go button无关,
是不是form还没分开,或者给go button的form加个其它的name
 
按照你分析的,也对,可是错误指示行就是指向function check()里的“len1=comeform.username.value.length;”
那两个引用文件是数据库的设置文件,没有关系呀
我的两个form不会错的呀:
<form method="post" name="comeform" onSubmit="return(check());" action="comein.asp">
<form method="post" name="paixu" action="0.asp">
会不会是comein.asp文件有问题
大侠帮忙看一看吧,谢谢!!!
——comein.asp——
<% if session("zkuser")<>"" then
response.redirect "0.asp"
response.end
end if
%>
<%
if request.servervariables("REQUEST_METHOD")<>"POST" then
response.redirect "no.htm"
response.end
end if
%>
<!--#include file="checkinfo.asp" -->
<!--#include file="majunconn.asp"-->
<%
dim rs
dim rsnew
dim rsrep
dim userinfo
dim score

set rs=server.createobject("adodb.recordset")
set rsnew=server.CreateObject("adodb.recordset")
set rsrep=server.CreateObject("adodb.recordset")

rs.open "select * from userinfo where username='"&amp;Trim(request.form("username"))&amp;"'" ,conn,1,3
rsnew.open "select * from newsinfo where name='"&amp;Trim(request.form("username")) &amp;
"'" ,conn,1,3
rsrep.open "select * from repinfo where repname='"&amp;Trim(request.form("username")) &amp;
"'" ,conn,1,3
score=rsnew.recordcount*5+rsrep.recordcount*3


if (rs.bof and rs.eof) then
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect "erruser.htm"
response.end
end if
if rs("password")<>Trim(request.form("password")) then
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect "errpwd.htm"
response.end
end if
session("zkuser")=rs("username")
%>
<html>
<head>
<style type="text/css">
</style>
<title>反恐论坛 -- 欢迎 <%=Trim(request.form("username"))%> 队员进入</title>
<STYLE>BODY {
SCROLLBAR-FACE-COLOR: 99ccff;
SCROLLBAR-HIGHLIGHT-COLOR: C6DE92;
SCROLLBAR-SHADOW-COLOR: #FFFFFF;
SCROLLBAR-3DLIGHT-COLOR: #FFFFFF;
SCROLLBAR-ARROW-COLOR: #000000;
SCROLLBAR-TRACK-COLOR: #FFFFFF;
SCROLLBAR-DARKSHADOW-COLOR: #FFFFFF
}
P {
COLOR: #333333;
FONT-FAMILY: 宋体;
FONT-SIZE: 9pt
}
INPUT {
COLOR: #333333;
FONT-FAMILY: 宋体;
FONT-SIZE: 9pt
}
SELECT {
COLOR: #333333;
FONT-FAMILY: 宋体;
FONT-SIZE: 9pt
}
TABLE {
BORDER-BOTTOM: 2px;
BORDER-LEFT: 0px;
BORDER-TOP: 1px
}
TD {
BORDER-RIGHT: 1px;
BORDER-TOP: 1px;
COLOR: #000000;
FONT-FAMILY: 宋体;
FONT-SIZE: 9pt
}
TD {
WORD-BREAK: break-all
}
</STYLE>
<STYLE>BODY {
SCROLLBAR-FACE-COLOR: 99ccff;
SCROLLBAR-HIGHLIGHT-COLOR: C6DE92;
SCROLLBAR-SHADOW-COLOR: #FFFFFF;
SCROLLBAR-3DLIGHT-COLOR: #FFFFFF;
SCROLLBAR-ARROW-COLOR: #000000;
SCROLLBAR-TRACK-COLOR: #FFFFFF;
SCROLLBAR-DARKSHADOW-COLOR: #FFFFFF
}
</STYLE>
</head>
<body bgcolor="#FFFFFF">
<Table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#0099FF">
<tbody>
<tr>
<td width="83%" height="43" align="left"> <div align="left"><img src="IMAGES/bbs.gif" width="170" height="71">
</div>

</TD>
<td width="17%" align="left"><img src="IMAGES/awp%20.jpg" width="150" height="50"></TD>
</tr>
<tr>
<td height="19" colspan="2" align="left"><hr align="left" width=100% size=1 color="#3399FF"></TD>
</tr>
</tbody>
</Table>
<table width="98%" border="0" align="center" bordercolor="#FFFFFF">
<tr>

<td width="76%" height="26"><font color="#0080C0" size="5" face="华文彩云"><strong>&amp;nbsp;&amp;nbsp;<IMG
alt=更多公告 border=0 src="images/gb.gif"
width=18></strong></font><font color="#0080C0" size="5"><font size="2"> <strong>会员登陆</strong></font></font></td>

<td width="11%"><a href="newspost.asp" target="_blank"><img src="IMAGES/newnews.gif" border="0"></a></td>

<td width="13%"><a href="0.asp"><img src="IMAGES/back .gif" border="0"></a></td>
</tr>
</table>
<table width="760" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#6699FF" class="9pb">
<tr >
<td height="26" align="center" background="IMAGES/tablebg.gif" ><font color="#FF0000"><strong>欢迎
<%=Trim(request.form("username"))%> 会员</strong></font> </td>
</tr>
<tr>
<td height="296">
<table width="66%" border="0" cellspacing="0" cellpadding="0" align="center" class="9pb">
<tr>

<td height="30"> 亲爱的 <strong><%=Trim(request.form("username"))%> </strong>会员,您好
</td>
</tr>
<tr>

<td height="127"> <br>
反恐论坛欢迎您的到来!<br>

我们真切的想创造一个平等、自由、稳定的论坛, 为此希望您作为CS论坛的一<br>员也能出一份力。<br>
<br>
特别注意:
<br><br>
我们的积分原则是:会员发布一篇主体文章积5分,发布一篇回复积3分。<br>
在您转载、转发、上载等操作时请注意版权问题, 论坛将不承担任何后果。<br> 您的加入就表示您已经完全同意上述意项!<br>
</td>
</tr>
<tr valign="bottom">

<td height="23" valign="middle">
<div align="left" class="9pw"><font color="#3366FF"><strong> 以下是您的会员信息</strong></font></div></td>
</tr>
<tr>
<td> <table width="496" border="0" cellspacing="0" cellpadding="0" class="9pb">
<tr>

<td width="98" align="center" valign="top">发表主题:</td>

<td width="398">
<% response.write (rsnew.recordcount)%>
篇&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
</td>
</tr>
<tr>

<td height="18" align="center" valign="top">发表回帖:</td>

<td>
<% 'curgrade=CheckGrade(rs("userinfo"),1)
response.write (rsrep.recordcount)%>
篇 </td>
</tr>
<tr>

<td height="15" align="center" valign="top">会员积分:</td>

<td><%=score%> 分</td>
</tr>
<tr>

<td height="18" align="center" valign="top">&amp;nbsp;</td>

<td>&amp;nbsp;
</td>
</tr>
</table></td>
</tr>
<tr>

<td height="25">
<div align="center">
<input type="button" name="Button2" value=" 进 入 " class="buttonface" onClick="location.href='0.asp'">
</div></td>
</tr>
</table> </td>
</tr>
</table>
<p align="center">Copyright 2003  All Rights Reserved<br>
版权所有<font color="#ff0000">&amp;nbsp;
</font><font color="#000000">&amp;copy;</font><font color="#ffffff">&amp;nbsp;
</font><font color="#000000">xiaodaihehe</font><font color="#000000">&amp;nbsp;</font></p>
</body>
</html>
<%
'rs("count")=rs("count")+1
'rs("card")=curgrade
'rs.update
'rs.close
'set rs=nothing
'conn.close
'set conn=nothing%>
<%
rs.close
rsnew.close
rsrep.close
set rs=nothing
set rsnew=nothing
set rsrep=nothing
conn.close
set conn=nothing
%>
 
comein.asp应该没关系,
只能一点一点排除了,编程有时就是这样的让人头痛,
先把出错的代码封了看看吧,
下面是捞干的,没有问题:
<SCRIPT language="javascript">
<!--
function check()
{
var len1=comeform.username.value.length;
if (len1==0)
{
alert("请输入您想注册的队员名称!");
comeform.username.focus();
return false;
}
else

if (comeform.username.value.indexOf(" ")!=-1)
{
alert("队员名称不能含有空格!");
comeform.username.focus();
return false;
}
else
return true;
}
// -->
</SCRIPT>
<%vv=request.form("vv")
if vv="" then
vv="555"
end if%>
<body><form action="" method="post" name="comeform" onSubmit="check()">
<input name="username" type="text">
<input type="submit" name="Submit" value="提交">
</form>
<form action="" method="post" name="vv"><input name="" type="submit" value="go">
<input type="text" name="vv" value=<%=vv%>>
</form>
 
接受答案了.
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
749
import
I
S
回复
0
查看
819
SUNSTONE的Delphi笔记
S
I
回复
0
查看
708
import
I
顶部