?? modquestion.jsp
字號(hào):
<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
<%@page contentType="text/html;charset=GB2312"%>
<%@include file="opendata.jsp"%>
<%@include file="check.jsp"%>
<%!
int isempty(String str) //判斷遞交的字符串是否為空
{
if(str.length() ==0)
return (0);
else return (1);
}
%>
<%!
String transfer(int i) //將時(shí)間數(shù)值轉(zhuǎn)換為標(biāo)準(zhǔn)格式
{
if(i>=10)
return (String.valueOf(i));
else return ("0"+String.valueOf(i));
}
%>
<%
String question = request.getParameter("question");
int questionid = Integer.parseInt(request.getParameter("questionid"));
int year,month,day,hour,minute,second;
String time;
GregorianCalendar calendar;
calendar = new GregorianCalendar();
year = calendar.get(Calendar.YEAR);
month = calendar.get(Calendar.MONTH)+1;
day = calendar.get(Calendar.DAY_OF_MONTH);
hour = calendar.get(Calendar.HOUR_OF_DAY);
minute = calendar.get(Calendar.MINUTE);
second = calendar.get(Calendar.SECOND);
time = year +"-"+transfer(month)+"-" + transfer(day) +" "+transfer(hour)+":"+transfer(minute)+":"+transfer(second);
if(question.length()==0)
{
String errmsg = "問(wèn)題不可為空!!!";
out.print("<center><font color=green size=5>錯(cuò)誤信息<hr></font><font color=red>"+errmsg+"</font><hr>");
out.print("<input type=button value=回上一頁(yè) onclick=history.back()>");
}
else
{
//更新主題
sql = "update Questions set Question = '"+question+"',Date = '"+time+"',IsVisable = 0 where QuestionID = "+questionid;
smt.executeUpdate(sql);
response.sendRedirect("edit.jsp?questionid="+questionid);
}
%>
<html>
<title>錯(cuò)誤信息</title>
</html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -