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

📄 carmodifysubmit.jsp

📁 汽车展销的网站开发
💻 JSP
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=gb2312"
    pageEncoding="gb2312" import="java.sql.*"%>
	<jsp:useBean id="mody" class="Bean.DbConn" scope="page"/>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>

<%
	request.setCharacterEncoding("GBK");
	int car_id=Integer.parseInt((String)session.getAttribute("car_id"));
	String type=request.getParameter("type");
	String price=request.getParameter("price");
	String prodtime=request.getParameter("prodtime");
	String browse_num=request.getParameter("browse_num");
	String cover=request.getParameter("cover");
	String introduction=request.getParameter("introduction");
	String commend=request.getParameter("commend");
	//out.print(commend);
	String strSql="update car set type='"+type+"',price='"+price+"',prodtime='"+prodtime+"',browse_num="+browse_num+",cover='"+cover+"',introduction='"+introduction+"',commend='是' where car_id="+car_id;
	int i=0;
	String str="";
	if(commend.equals("是"))
	{
		str=strSql;
	}
	else
	str="update car set type='"+type+"',price='"+price+"',prodtime='"+prodtime+"',browse_num="+browse_num+",cover='"+cover+"',introduction='"+introduction+"',commend='否' where car_id="+car_id;
	//out.print(str);
	mody.open();//链接数据库
	
	i=mody.executeUpdate(str);
	
	
	if(i!=0)
	{
		out.print("<script>alert('修改成功!');window.history.go(-1);</script>");
	}
%>

</body>
</html>

⌨️ 快捷键说明

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