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

📄 save.jsp

📁 本程序的功能如下: 1)本程序完全采用jsp脚本技术 2)后台管理
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="../conn.jsp"%>
<%request.setCharacterEncoding("gb2312");
String actions;
String classid=request.getParameter("Classid");
String Nclassid=request.getParameter("Nclassid");
String softname=request.getParameter("softname");
String yxhj=request.getParameter("yxhj");
String grade=request.getParameter("Grade");
String downurl=request.getParameter("downurl");
String urlsay=request.getParameter("urlsay");
String softsize=request.getParameter("softsize");
String codeshow=request.getParameter("codeshow");
String abouturl=request.getParameter("abouturl");
String images=request.getParameter("images");
String sq=request.getParameter("sq");
String lang=request.getParameter("lang");
String tj=request.getParameter("tj");
String jp=request.getParameter("jp");
String jb=request.getParameter("jb");
String note=request.getParameter("txtnote");
if((session.getAttribute("admin")==null)){
response.sendRedirect("admin.jsp");
}else{
  if((softname==null)|(softname.equals(""))){%>
  <script language="javascript">
  alert("软件名称不能为空");
  window.history.go(-1);
  </script>
  <%}else{
    if ((note==null)|(note.equals(""))){%>
	<script language="javascript">
	alert("软件简介不能为空");
	window.history.go(-1);
	</script>
	<% }else{
	//out.print(classid);
		if((classid==null)|(classid.equals("==请选类型=="))){
 		out.print("<script language=Javascript>alert('请选择类型');");
 		out.print("window.histroy.go(-1);</script>"); 
		 }else{
			 if((Nclassid==null)|(Nclassid.equals("==请选分类=="))){
  			 out.print("<script language=Javascript>alert('请选择分类');");
 			 out.print("window.histroy.go(-1);</script>"); 
  			 }else{
  				actions="add";
				//out.print(request.getParameter("action"));
  				if(actions.equals(request.getParameter("action"))){
 				String sql="INSERT INTO download(softname,downurl,urlsay,softsize,codeshow,abouturl,images,sq,lang,tj,jp,jb,note,yxhj,grade,classid,nclassid)";
 				sql=sql+" VALUES('"+softname+"','"+downurl+"','"+urlsay+"','"+softsize+"','"+codeshow+"','"+abouturl+"','"+images+"','"+sq+"','"+lang+"','"+tj+"','"+jp+"','"+jb+"','"+note+"','"+yxhj+"','"+grade+"','"+classid+"','"+Nclassid+"')";
 			//out.print(sql);
			   stmt.executeUpdate(sql);
  					}else{
 					 actions="edit";
				 	 if(actions.equals(request.getParameter("action"))){
 					 String sql="Update download set softname='"+softname+"',downurl='"+downurl+"',urlsay='"+urlsay+"',softsize='"+softsize+"',codeshow='"+codeshow+"',abouturl='"+abouturl+"',images='"+images+"',sq='"+sq+"',lang='"+lang+"',tj='"+tj+"',jp='"+jp+"',jb='"+jb+"',note='"+note+"',yxhj='"+yxhj+"',grade='"+grade+"',nclassid='"+Nclassid+"'  where id='"+request.getParameter("softid")+"'";
 					 //out.print(sql);
					 stmt.executeUpdate(sql);
 					} 
					 
  				}
  
      		  }
 			}


%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type=text/css>
<!--
BODY{
	margin:0px;
	FONT-SIZE: 12px;
	FONT-FAMILY:  "宋体", "Verdana", "Arial", "Helvetica", "sans-serif";
	scrollbar-face-color: #DEE3E7;
	scrollbar-highlight-color: #FFFFFF;
	scrollbar-shadow-color: #DEE3E7;
	scrollbar-3dlight-color: #D1D7DC;
	scrollbar-arrow-color:  #006699;
	scrollbar-track-color: #EFEFEF;
	scrollbar-darkshadow-color: #98AAB1;
	background-color: #D4DEF9;
}
table  { border:0px; }
td  { font:normal 12px 宋体; }
img  { vertical-align:bottom; border:0px; }
a  { font:normal 12px 宋体; color:#000000; text-decoration:none; }
a:hover  { color:#428EFF;text-decoration:underline; }
.sec_menu  { border-left:1px solid white; border-right:1px solid white; border-bottom:1px solid white; overflow:hidden; background:#D6DFF7; }
.menu_title  { }
.menu_title span  { position:relative; top:2px; left:8px; color:#215DC6; font-weight:bold; }
.menu_title2  { }
.menu_title2 span  { position:relative; top:2px; left:8px; color:#428EFF; font-weight:bold; }
input,select,Textarea{
font-family:宋体,Verdana, Arial, Helvetica, sans-serif; font-size: 12px;}
}
.style1 {
	color: #3D6DD3;
	font-weight: bold;
}
-->
</style>
<title>无标题文档</title>
</head>
<body bgcolor="#D4DEF9">
<br><br>
<table bgcolor="#39867b" width="100%" height="" align="center" cellpadding="3" cellspacing="1" border="0">
<tr><td width="100%" height="20" bgcolor="#e1f4ee">
<p align="center">
<font color="#000000">
<%actions="add";
if(actions.equals(request.getParameter("action"))){
out.print("添加");
}else{
out.print("修改");
}

%>程序成功
</font>
</p></td></tr>
<tr>
<td width="100%" bgcolor="#e1f4ee">
<p align="left">
<br>
显示名称为:<%=request.getParameter("softname")%>&nbsp;程序演示地址:<%=codeshow%><br></p>
您可以进行其它操作:<a href="addsoft.jsp" target="_self">添加</a> <a href="editsoft.jsp" target="_self">修改删除</a>
</td>
</tr>

</table>

</body>
</html>
<%}
}
}
%>

⌨️ 快捷键说明

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