?? ly_in.jsp
字號(hào):
<%@page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<title>添加留言</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<jsp:useBean id="liuyan" scope="page" class="liuyan.jdbc" />
<%
Connection con = liuyan.getConn() ;
Statement stmt = con.createStatement() ;
ResultSet rs = null;
String content = request.getParameter("content") ;
content = liuyan.ex_chinese(content) ;
String qq = request.getParameter("qq") ;
qq = liuyan.ex_chinese(qq) ;
String email = request.getParameter("email") ;
email = liuyan.ex_chinese(email) ;
String url = request.getParameter("url") ;
url = liuyan.ex_chinese(url) ;
String xm = request.getParameter("yhm") ;
xm = liuyan.ex_chinese(xm) ;
String msg = "您在留言成功。" ;
try
{
String sql = "select MAX(id) from liuyan_table";
rs = stmt.executeQuery(sql);
int id = 0;
if(rs.next())
{
id = rs.getInt(1) + 1;
}
sql = "insert into liuyan_table(id,url,ip,email,qq,sj,content,xm) values("+id+",'"+url+"','"+request.getRemoteHost()+"','"+email+"','"+qq+"','"+liuyan.gettime()+"','"+content+"','"+xm+"')" ;
stmt = null;
stmt = con.createStatement();
stmt.executeUpdate(sql) ;
}
catch(Exception e)
{
e.printStackTrace();
}
finally
{
try {
stmt.close();
con.close();
}
catch (Exception ex) {
}
}
%>
<body>
<p> </p><table border="1" align="center" cellspacing="0" bordercolorlight="000000" bordercolordark="FFFFFF" bgcolor="E0E0E0">
<tr>
<td> <table border="0" bgcolor="#0066CC" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td width="342"><font color="FFFFFF">¤<%=msg%></font></td>
<td width="18"> </td>
</tr>
</table>
<table border="0" width="100%" cellpadding="4">
<tr>
<td width="59" align="center" valign="top"><font face="Wingdings" color="#FF0000" style="font-size:32pt">L</font></td>
<td width="269">
<p><%=msg%></p>
</td>
</tr>
<tr>
<td colspan="2" align="center" valign="top"> <input type="button" name="ok" value="關(guān)閉窗口" onclick="window.close()">
</td>
</tr>
</table></td>
</tr>
<script language="javascript">
opener.location=opener.location;window.close();
</script>
</table>
</body>
</html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -