forked from maxliaops/Java_Web_Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbout_Update.jsp
More file actions
37 lines (37 loc) · 865 Bytes
/
About_Update.jsp
File metadata and controls
37 lines (37 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<%@ page contentType="text/html; charset=gb2312"%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<jsp:useBean id="data" scope="session" class="cars.Bean1" />
<%!
String sql;
String type;
String content;
%>
<% request.setCharacterEncoding("gb2312");%>
<%
type=request.getParameter("action");
content=request.getParameter("content");
if(type.equals("future")){
sql="update tb_News set Content='"+content+"' where Title='未来展望'";
int i=data.getint(sql);
if(i>0){
%>
<script language="javascript">
alert("信息更新成功");
location.href="Manage.jsp?id=7";
</script>
<%
}
}
else{
sql="update tb_News set Content='"+content+"' where Title='历史回顾'";
int i=data.getint(sql);
if(i>0){
%>
<script language="javascript">
alert("信息更新成功");
location.href="Manage.jsp?id=7";
</script>
<%
}
}
%>