为什么动态表单及网页内容都显示不出来只能显示网页背景
这是网页的代码,希望大家帮我看一下,我实在是不明白了,谢谢<body>
<%
dim UserID,IPAdd,UserPwd,NickName,TimeLogin
dim mysql,mysql1
if Request.ServerVariables("REQUEST_METHOD")="Post" then
UserID=Request.Form("UID")
UserPwd=Request.Form("PWD")
NickName=Request.Form("NickName")
'session("nickname")=NickName
set myconn=server.CreateObject("ADODB.Connection")
myconn.ConnectionString="DSN=ChatRoom"
myconn.Open
mysql="select UserID,PWD,IfClosed,OpenTime from EverUser where UserID='"& UserID &"' and UserPwd='"& UserPwd &"'"
mysql1="select IPAdd,TimeOpen,IfClosed from FaultIpAdd where IPAdd='"& Request.ServerVariables("Remote_Host") &"'"
mysql2="update EverUser set NickName='"& NickName &"',IPAdd='"& Request.ServerVariables("Remote_Host") &"',TotalVisit=TotalVisit+1 where UserID='"& UserID &"'"
mysql3="insert into UserOnLine(UserID,PWD,NickName) values ('"& UserID &"','"& UserPwd &"','"& NickName &"')"
mysql4="select * from RoomInfo"
mysql5="select * from UserOnline where UserID='"&UserID &"'"
set myrecord0=myconn.Execute(mysql5)
if not myrecord0.bof then
if dateadd("n",5,myrecord0("TimeLastTalking"))>now then
Response.Write("你已经登录过了,请在五分钟后再登录?")
Response.End
else
newsql="delete from UserOnline where UserID='"&UserID&"'"
end if
end if
set myrecord1=myconn.Execute(mysql1)
if not myrecord1.BOF then
if myrecord1("IfClosed")<>true then
IfClosed=1
end if
end if
if myrecord1.bof or IfClosed=1 then
set myrecord=myconn.Execute(mysql)
if myrecord.eof then
Response.Write ("密码或账号输入错误!<a href='default.asp'>请重新登录</a>")
Response.End
elseif myrecord("IfClosed")then
if myrecord("OpenTime")<date() then
Response.Write("你的账号刚刚被解封,<a href='default.asp'>请重新登录</a>,以后请注意!")
mysql="update EverUser set IfClosed=false where UserID='"&UserID&"'"
myconn.Execute(mysql)
Response.End
else
Response.Write("你的账号已经被封,到"&myrecord("OpenTime")&"才开放!")
Response.End
End if
else
if session("refresh")=""then
myconn.Execute(mysql2)
myconn.Execute(mysql3)
session("refresh")=true
end if
set myrecord2=myconn.Execute(mysql4)
%>
<form name="room" action="main.asp" method="Post" onsubmit="javascript:return check()">
<table border="5" width="100%" bgcolor="#FF99CC" height="39" cellspacing="5" cellpadding="5">
<tr>
<td width="50%" height="18">
<p align="center"><b><font color="#ff0000">新建聊天室</font></b></p>
</td>
<td width="50%" height="18">
<p align="center"><b><font color="#ff0000">话题</font></b></P>
</td>
<td width="50%" height="18">
<p align="center"><input name="B1" type="submit" id="B1" style="BACKGROUND-COLOR:#00FFFF;COLOR:#FF0000;FONT-WEIGHT:BOLD;TEXT-DECORATION:BLINK" value="提交">
</P>
</td>
</tr>
<tr>
<td width="50%" height="9">
<p align="center"><input name="newroom"></p>
</td>
<td width="50%" height="9">
<p align="center"><input name="topic"></p>
</td>
<td width="50%" height="9">
<p align="center"><input type="reset" value="清除" name="B2" style="background-color:#00ffff;color:#ff0000;font-weight:bold;text-decoration:blink">
</p>
</td>
</tr>
</table>
<input type="hidden" name="user" value=<%=UserID%>>
</form>
<hr size="4" color="#000080">
<!--下面的表单为显示房间信息-->
<table border="2" width="100%" background="images/bg1.gif" cellpadding="2" height="76">
<tr>
<td width="10%" align="middle" height="48"><div align="center" class="style6"><font size="3" color="#008000">房间号</font> </div></td>
<td width="20%" align="middle" height="48"><div align="center" class="style6"><font size="3" color="#008000">房间名称</font> </div></td>
<td width="20%" align="middle" height="48"><div align="center" class="style6"><font size="3" color="#008000">话题</font> </div></td>
<td width="20%" align="middle" height="48"><div align="center" class="style6"><font size="3" color="#008000">聊天人数</font> </div>
<td width="15%" align="middle" height="48"><div align="center" class="style6"><font size="3" color="#008000">是否上锁</font> </div>
<td width="15%" align="middle" height="48"><div align="center" class="style6"><font size="3" color="#008000">创建者</font> </div></td>
</tr>
<%
do while not myrecord2.eof
if myrecord2("IfLocked")=true then
newsql="select UserID from UserOnLine where RoomName='"&myrecord2("RoomName")&"'and UserID='"&myrecord2("WhoCreate")&"'"
set myrecord3=myconn.Execute(newsql)
if myrecord3.bof then
newsql="update RoomInfo set IfLocked=false where RoomName='"&myrecord2("RoomName")&"'"
myconn.Execute(newsql)
Changed=true
end if
myrecord3.close
end if
%>
<tr>
<td width="10%" align="middle" height="2"><p align="center" class="style6"><font color=purple size=5>
<% =myrecord2("RoomID")%>
</font></p></td>
<%
if myrecord2("IfLocked")=false or Changed=true then
%>
<td width="20%" align="middle" height="2"><span class="style7"><font color=purple size=5><strong> <%=myrecord2("RoomName")%> </strong></font><font color=maroon size=2>
<!--显示进入房间链接-->
<a href=main.asp?roomname=<% =myrecord2("RoomName") %>&user=<%=UserID%>>进入</a></font> </span></td>
<%
else
%>
<td width="20%" align="middle" height="2"><span class="style7"><font color=purple size=5><strong>
<!--显示房间名-->
<%=myrecord2("RoomName")%> </strong></font><font color=maroon size=2>锁住</font> </span></td>
<%
end if
%>
<td width="20%" align="middle" height="2"><div align="center" class="style7"><font color=purple><strong>
<!--显示房间话题-->
<%=myrecord2("Topic")%> </strong></font>
<p></p>
</div></td>
<td width="20%" align="middle" height="2"><p align="center" class="style7"><font color=purple><strong>
<!--显示房间人数-->
<% =myrecord2("HowManyUsers")%>
</strong></font></p></td>
<td width="15%" align="middle" height="2"><p align="center" class="style7"><font color=purple><strong>
<!--显示房间状态-->
<%=myrecord2("IfLocked")%> </strong></font></p></td>
<td width="15%" align="middle" height="2"><p align="center" class="style7"><font color="purple"><strong>
<!--显示房间创建者-->
<% =myrecord2("WhoCreate") %>
</strong></font></p></td>
</tr>
<p>
<%
myrecord2.movenext
loop
%>
</table>
<div align="center">
<%
end if
else
if myrecord1("TimeOpen")<date() then
Response.Write("你的IP地址刚刚被解封,<a href='default.asp'>请重新登录</a>,请以后注意!")
mysql="update FaultIpAdd set IfClosed=false where IpAdd='"&Request.ServerVariables("Remote_Host")&"'"
myconn.Execute(mysql)
Response.End
else
Response.Write("你的IP地址已经被封住了,直到"&myrecord1("TimeOpen")&"才能开放!")
Response.End
end if
end if
myrecord.close
set myrecord=nothing
myrecord1.close
set myrecord1=nothing
myrecord2.close
set myrecord2=nothing
set myconn=nothing
end if
%>
</p>
</div>
</body>
</html>
[此贴子已经被作者于2006-2-1 22:00:11编辑过]