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

📄 send_save.jsp

📁 jsp编程jsp工程项目与实践 jsp源代码
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="../error/error.jsp" %>
<!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>
<jsp:useBean id="time" class="useBean.Usetime" scope="request" />
<jsp:useBean id="liao" class="useBean.Link_db" scope="request" />
</head>
<%	
	String username="";
	String biaoqing="";
	String lname="";
	String said="";
	String nowtime=time.gethhTime();
	String sqli="";
	String selcolor="";
	try{
		username=(String)session.getAttribute("name");
	}catch(Exception e){
		session.setAttribute("error","用户名不存在");
		response.sendRedirect("errorpage.jsp");
	}
		biaoqing=(String)request.getParameter("biaoqing");
		biaoqing=liao.chStr(biaoqing);
		selcolor=(String)request.getParameter("selcolor");
		selcolor=liao.chStr(selcolor);
		lname=(String)request.getParameter("lname");
		lname=liao.chStr(lname);
		said=(String)request.getParameter("said");
		said=liao.chStr(said);
		if(lname!=""||said!=""){
			sqli="INSERT INTO liaotian(发送时间,发送人,表情,字颜色,接受人,聊天纪录) VALUES('"+nowtime+"','"+username+"','"+biaoqing+"','"+selcolor+"','"+lname+"','"+said+"')";
			liao.update(sqli);
		}
		liao.close();
		response.sendRedirect("liao.jsp");
%>
</html>

⌨️ 快捷键说明

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