⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 10c63e4b28c1001c147e826bcadc34ab

📁 基于Java实现的聊天室功能
💻
字号:
<%@page pageEncoding="GBK"%>
<%@page import="liuyan.*,java.util.*,java.text.SimpleDateFormat" %>
<HTML>
<HEAD>
<TITLE>教学督导组--部门首页</TITLE>
<META http-equiv="content-type" content="text/html; charset=gb2312">
<LINK rel='stylesheet' href='css/dep0.css'>
<%
    request.setCharacterEncoding("gb2312");
    String name = (String)request.getParameter("Xm");
    String sex = (String)request.getParameter("Xb");
    String comefrom = (String)request.getParameter("Lznl");
    String lianxi = (String)request.getParameter("Lxfs");
    String qq = (String)request.getParameter("Qq");
    String email = (String)request.getParameter("Dzyj");
    String zhuye = (String)request.getParameter("Grzy");
    String other = (String)request.getParameter("Icq");
    String bq = (String)request.getParameter("MsgBq");
    String title = (String)request.getParameter("Bt");
    String content = (String)request.getParameter("Lr");
    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    Date date = new Date();
    if(name!=null&&title!=null&&content!=null){
        String sql = "insert into lyinfo(name,sex,comefrom,lianxi,qq,email,zhuye,other,lytime,bq,title,content)"+
        "values('"+name+"','"+sex+"','"+comefrom+"','"+lianxi+"','"+qq+"','"+email+"','"+zhuye+"',"+
        "'"+other+"','"+formatter.format(date)+"','"+bq+"','"+title+"','"+content+"')";
        Liuyan liuyan = new Liuyan();
        if(liuyan.executeUpdate(sql))
           out.print("<script>alert('留言成功,请等候管理员的审核!!!')</script>");
        else out.print("<script>alert('留言失败,请重试!!!')</script>");
    }
 %>
</HEAD>
<STYLE type=text/css>
BODY {font-size:10pt;font-family:Tahoma,Verdana,MS Sans Serif,Courier New;}
TD,TR{font-size:10pt;}
FONT {TEXT-DECORATION: none}
INPUT.text,INPUT.file,SELECT,TEXTAREA{color:#000000;background-color:#F0F0F0;border:1 solid #101010;margin:2}
FONT.strong {COLOR: #000000; FONT-WEIGHT: bold}
</style>
<BODY bgcolor=#CCCCCC style='margin:0'>

<CENTER>
<TABLE class=maintbl width=760 border=0 cellPadding=0 cellSpacing=0 align=center>
	<TR><TD width=760 height=1></TD></TR>
	<TR>
		<TD>
			<TABLE width='100%' border=0 cellPadding=0 cellSpacing=0>
				<TR>
					<TD><IMG src='Img/top.jpg' width=766 height=93></TD>
				</TR>
			</TABLE>
		</TD>
	</TR>
	<TR>
		<TD width=760 height=9 style='line-height:0px; border:#737BB6 2px solid; border-width:2px 0px 0px 0px'>&nbsp;</TD>
	</TR>
	<TR>
		<TD>
			<TABLE width='100%' border=0 cellPadding=0 cellSpacing=0>
				<TR>
					<TD width=147 height=20 bgColor='#FFFFFF' align=center><IMG src='Img/Tuanjie.jpg'></TD>
					<TD width=10 bgColor='#FFFFFF'></TD>
					<TD width=603 height=20 bgColor='#FFFFFF' Valign=bottom>
						<MARQUEE direction=left width=600 height=16 scrolldelay=80 scrollamount=6 behavior="alternate" id='board' onmouseover='board.stop()' onmouseout='board.start()'>
						<font color=#0000CC><a href='/Dep/Default.asp?bm=33' target=_top style='color:#0000FF'>
欢迎您访问<b>湖北工业大学--教学督导组</b>的主页</a></font></MARQUEE>
					</TD>
				</TR>
			</TABLE>
		</TD>
	</TR>
	<TR><TD width=760 height=10></TD></TR>
</TABLE>
</CENTER>
<script language="VBscript">
<!--
Function zLen(str)
	dim strlen,i,sjlen
	strlen = len(str)
	zLen=0
	if not strlen = 0 then
		sjlen=0
		For i=1 to strlen
			If ASCW(Mid(str,i,1))<128 and ASCW(Mid(str,i,1))>0 Then sjlen=sjlen+1 Else sjlen=sjlen+2
		Next
		zLen=sjlen
	end if
End Function
Function zDate(str)
	dim strlen
	If IsDate(str) Then
		zDate=True
	Else
		zDate=False
	End If
End Function
Function FormDate(str)
	FormDate=Year(str) & "-" & Right(100+Month(str),2) & "-" & Right(100+Day(str),2)
End Function
Function FormDateTime(str)
	If str="" Then
		FormDateTime=""
		Exit Function
	End If
	FormDateTime=Year(str) & "-" & Right(100+Month(str),2) & "-" & Right(100+Day(str),2) & " " & _
		Right(100+Hour(str),2) & ":" & Right(100+Minute(str),2)
End Function

Sub FormatStr(x)
	Dim Lines,i,MaxLine,OneLine

	Lines=Split(form1.Lr.value,VbCrLf)
	form1.Lr.value=VbCrLf
	MaxLine=Ubound(Lines)
	For i=0 to MaxLine
		OneLine=Trim(Lines(i))
		If OneLine<>"" Then
			If Left(OneLine,1)<>" " Then
				OneLine="  " & OneLine
			Else
				If Left(OneLine,2)<>"  " Then
					OneLine="  " & OneLine
				End If
			End If
			form1.Lr.value=form1.Lr.value & OneLine
			If i<>MaxLine Then form1.Lr.value=form1.Lr.value & VbCrLf & VbCrLf
		End If
	Next
	focusto x
End Sub
-->
</script>

<script language="VBscript">
<!--
sub datacheck()
   dim year,month,day,date,email,Temp
Temp=Trim(form1.Xm.value)
form1.Xm.value=Temp
If Temp=Empty then
	MsgBox "请输入“留言者姓名”!",64,"错误!"
	focusto(0)
	exit sub
End If
If zLen(Temp)<4 or zLen(Temp)>20 Then
	MsgBox "“留言者姓名”应由2~10个汉字(4~20个字母或数字)组成!",64,"错误!"
	focusto(0)
	exit sub
End If
Temp=Trim(form1.Lznl.value)
form1.Lznl.value=Temp
If zLen(Temp)<0 or zLen(Temp)>30 Then
	MsgBox "“来自哪里”字数不能超过15个汉字(30个字母或数字)!",64,"错误!"
	focusto(3)
	exit sub
End If
Temp=Trim(form1.Lxfs.value)
form1.Lxfs.value=Temp
If zLen(Temp)<0 or zLen(Temp)>100 Then
	MsgBox "“保密联系方式”字数不能超过50个汉字(100个字母或数字)!",64,"错误!"
	focusto(4)
	exit sub
End If
Temp=Trim(form1.Qq.value)
form1.Qq.value=Temp
If zLen(Temp)<0 or zLen(Temp)>20 Then
	MsgBox "“QQ号码”字数不能超过20个字母或数字!",64,"错误!"
	focusto(5)
	exit sub
End If
Temp=Trim(form1.Icq.value)
form1.Icq.value=Temp
If zLen(Temp)<0 or zLen(Temp)>20 Then
	MsgBox "“ICQ或其他号码”字数不能超过20个字母或数字!",64,"错误!"
	focusto(6)
	exit sub
End If
Temp=Trim(form1.Dzyj.value)
form1.Dzyj.value=Temp
If zLen(Temp)<0 or zLen(Temp)>30 Then
	MsgBox "“电子邮件地址”字数不能超过30个字母或数字!",64,"错误!"
	focusto(7)
	exit sub
End If
Temp=Trim(form1.Grzy.value)
form1.Grzy.value=Temp
If zLen(Temp)<0 or zLen(Temp)>60 Then
	MsgBox "“个人主页地址”字数不能超过60个字母或数字!",64,"错误!"
	focusto(8)
	exit sub
End If
Temp=Trim(form1.Bt.value)
form1.Bt.value=Temp
If Temp=Empty then
	MsgBox "请输入“留言标题”!",64,"错误!"
	focusto(23)
	exit sub
End If
If zLen(Temp)<4 or zLen(Temp)>60 Then
	MsgBox "“留言标题”应由2~30个汉字(4~60个字母或数字)组成!",64,"错误!"
	focusto(23)
	exit sub
End If
Temp=Trim(form1.Lr.value)
form1.Lr.value=Temp
If Temp=Empty then
	MsgBox "请输入“留言内容”!",64,"错误!"
	focusto(24)
	exit sub
End If
If zLen(Temp)<1 or zLen(Temp)>20000 Then
	MsgBox "“留言内容”限10000个汉字(20000个字母或数字)以内!",64,"错误!"
	focusto(24)
	exit sub
End If

form1.submit
end sub
-->
</script>

<form name="form1" method="post" action="ly.jsp" style="margin-top:0;margin-bottom:0">

<table border=0 cellpadding=0 cellspacing=0 width=766 cols=1 align=center><tbody>
	<TR><td bgcolor="#DEDFDF">
		<table border=0 cellpadding=0 cellspacing=1 cols=3 width=766 bgcolor="#CCCCFF"><tbody>
			<tr bgcolor=#E4E4FF><td colspan=4 height=26 align=Left valign=bottom><p style="margin:4">写给 [<b>教学督导组</b>] 的留言(<span style="color:#0000FF">正在添加——注意,留言需管理员审阅认可后才被公开,您不会马上在网页上看到您现在的留言!</span>)</p><p style='color:#FF0000;margin-top:10;margin-bottom:10;margin-left:16'> ★“教学投诉”留言板只接受与教学质量、学风、教风有关的投诉,其他教学业务问题(例如成绩、学籍等)请咨询教务处。★</p></td></tr>
			<tr bgcolor=#E6E6FF height=24><td align=right width=100>* 留言者姓名:</td>
				<td width=275><input title="2~10个汉字以内" type="text" onFocus="jacvascript:this.select()" class=text value="" name="Xm" size="36" maxlength="20"></td>
				<td width=100 align=Right>留言者性别:</td>
				<td width=275> <INPUT type="radio" value="男" name="Xb" >
				男  <INPUT type="radio" value="女" name="Xb" >
				女</td>
			</tr>
			<tr bgcolor=#E6E6FF height=24><td align=Right width=100>来自哪里:</td>
				<td width=275><input title="15个汉字(30个字母或数字)以内" type="text" onFocus="jacvascript:this.select()" class=text value="" name="Lznl" size="36" maxlength="30"></td>
				<td width=100 align=Right>保密联系方式:</td>
				<td width=275><INPUT class=text TYPE="TEXT" onFocus="jacvascript:this.select()" title="保密联系方式仅管理员知晓,不会被公开,限50个汉字(100个字母或数字)以内" value="" NAME="Lxfs" SIZE=36 MAXLENGTH=100></td>
			</tr>
			<tr bgcolor=#E6E6FF height=24><td align=Right width=100>QQ号码:</td>
				<td width=275><input title="限20个数字以内" type="text" onFocus="jacvascript:this.select()" class=text value="" name="Qq" size="36" maxlength="20"></td>
				<td width=100 align=Right>ICQ或其他:</td>
				<td width=275><INPUT class=text TYPE="TEXT" onFocus="jacvascript:this.select()" title="限20个数字以内" value="" NAME="Icq" SIZE=36 MAXLENGTH=20></td>
			</tr>
			<tr bgcolor=#E6E6FF height=24><td align=Right width=100>电子邮件:</td>
				<td width=275><input title="限30个字母或数字以内" type="text" onFocus="jacvascript:this.select()" class=text value="" name="Dzyj" size="36" maxlength="30"></td>
				<td width=100 align=Right>个人主页:</td>
				<td width=275><INPUT class=text TYPE="TEXT" onFocus="jacvascript:this.select()" title="限60个字母或数字以内" value="" NAME="Grzy" SIZE=36 MAXLENGTH=60></td>
			</tr>
			<tr bgcolor=#E6E6FF height=24><td align=Right width=100>留言表情:</td>
				<td colspan=3><INPUT type="radio" name="MsgBq" value="10" checked>&nbsp;<IMG SRC="Img/Icon10.gif" HEIGHT=10 WIDTH=16 ALIGN=ABSCENTER>&nbsp;  
<INPUT type="radio" name="MsgBq" value="11" >&nbsp;<IMG SRC="Img/Icon11.gif" HEIGHT=18 WIDTH=18 ALIGN=ABSCENTER>&nbsp;  
<INPUT type="radio" name="MsgBq" value="13" >&nbsp;<IMG SRC="Img/Icon13.gif" HEIGHT=18 WIDTH=18 ALIGN=ABSCENTER>&nbsp;  
<INPUT type="radio" name="MsgBq" value="2" >&nbsp;<IMG SRC="Img/Icon2.gif" HEIGHT=18 WIDTH=18 ALIGN=ABSCENTER>&nbsp;  
<INPUT type="radio" name="MsgBq" value="5" >&nbsp;<IMG SRC="Img/Icon5.gif" HEIGHT=18 WIDTH=18 ALIGN=ABSCENTER>&nbsp;  
<INPUT type="radio" name="MsgBq" value="7" >&nbsp;<IMG SRC="Img/Icon7.gif" HEIGHT=18 WIDTH=18 ALIGN=ABSCENTER>&nbsp;  
<INPUT type="radio" name="MsgBq" value="9" >&nbsp;<IMG SRC="Img/Icon9.gif" HEIGHT=18 WIDTH=18 ALIGN=ABSCENTER>&nbsp;  
<BR>
<INPUT type="radio" name="MsgBq" value="1" >&nbsp;<IMG SRC="Img/Icon1.gif" HEIGHT=18 WIDTH=18 ALIGN=ABSCENTER>&nbsp;  
<INPUT type="radio" name="MsgBq" value="12" >&nbsp;<IMG SRC="Img/Icon12.gif" HEIGHT=18 WIDTH=18 ALIGN=ABSCENTER>&nbsp;  
<INPUT type="radio" name="MsgBq" value="14" >&nbsp;<IMG SRC="Img/Icon14.gif" HEIGHT=18 WIDTH=18 ALIGN=ABSCENTER>&nbsp;  
<INPUT type="radio" name="MsgBq" value="3" >&nbsp;<IMG SRC="Img/Icon3.gif" HEIGHT=20 WIDTH=19 ALIGN=ABSCENTER>&nbsp;  
<INPUT type="radio" name="MsgBq" value="4" >&nbsp;<IMG SRC="Img/Icon4.gif" HEIGHT=18 WIDTH=18 ALIGN=ABSCENTER>&nbsp;  
<INPUT type="radio" name="MsgBq" value="6" >&nbsp;<IMG SRC="Img/Icon6.gif" HEIGHT=18 WIDTH=18 ALIGN=ABSCENTER>&nbsp;  
<INPUT type="radio" name="MsgBq" value="8" >&nbsp;<IMG SRC="Img/Icon8.gif" HEIGHT=18 WIDTH=18 ALIGN=ABSCENTER>&nbsp;  </td>
			</tr>

			<tr bgcolor=#E6E6FF height=24><td align=Right width=100>* 留言标题:</td>
				<td width=275 colspan=3><INPUT class=text onFocus="jacvascript:this.select()" title="2~30个汉字以内" TYPE="TEXT" value="" NAME="Bt" SIZE=90 MAXLENGTH=60></td>
			</tr>
			<TR bgcolor=#E6E6FF height=24><td align=Right width=100>* 留言内容:</td>
			<td width=275 colspan=3><textarea name="Lr" cols="88" rows="10" onFocus="jacvascript:this.select()" Title="字数限10000个汉字(20000个字母或数字),仅支持纯文本方式。留言不会马上显示在系统中,必须等待管理者审批后方可公布。">
</textarea></td>
			</tr>
			<tr bgcolor=#E6E6FF>
				<td colspan=4 align=center>
					<input type="hidden" name="Id" value="-1">     
					<input type="hidden" name="bm" value="33">     
					<input type="button" name="Button" value="提  交" onClick="VBscript:datacheck">     
					<input type="reset" name="Submit2" value="全部重写">     
					<input type="button" name="BtFormat" value="格式化内容" onClick="VBscript:FormatStr(3)">
		      </td></tr>
		</tbody></table>
	</td></tr>
</tbody></table>
</form>

<!-- ImageReady Slices (1) -->
<div align="center">
  <center>
<TABLE WIDTH=766 BORDER=0 CELLPADDING=0 CELLSPACING=0 height="85" style="border-collapse: collapse" bordercolor="#111111">
	<TR><TD height=0 Colspan=2 bgcolor="#FFFFFF"></TD></TR>

	<TR><TD width="580" height="77" bgcolor="#8CAEDE">
		<div align="center">
              	<center>
              	<table height="46" cellSpacing="0" cellPadding="0" width="100%" border="0" style="border-collapse: collapse" bordercolor="#111111">
                <tr>
                  <td vAlign="center" align="middle" height="15">
                  <span style="font-size: 9pt">湖北·武汉市武昌区南湖大道  邮编:430068</span></td>
                </tr>
                <tr>
                  <td vAlign="center" align="middle" height="17">学院值班电话:027-********  网络故障报修与服务电话:027-********,********  <a href="ly.jsp"><span style="font-size: 9pt">[留言]</span></a></td>
                </tr>
                <tr>
                  <td vAlign="center" align="middle" height="14"><span style="font-size: 9pt">Copyright&copy;湖北工业大学 2007-2010  建议使用IE5.5,800*600以上浏览</span><a href="mailto:nic@hbut.edu.cn"> </a></td>
                </tr>
              </table>
              </center>
          </div>
        </TD>
	<TD height="77"><IMG SRC="Img/foot_2.gif" WIDTH=188 HEIGHT=77 ALT=""></TD>
	</TR>
	<TR>
		<TD COLSPAN=2 bgcolor="#003063" height="8"><hr color="#003063" size="1"></TD>
	</TR>
</TABLE>
  </center>
</div>
<!-- End ImageReady Slices -->
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -