📄 modifyask.jsp
字号:
<%@ page language="java" contentType="text/html; charset=gb2312"
pageEncoding="GB2312"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<jsp:useBean id="user" scope="page" class="edu.UserBean" />
<jsp:useBean id="teacher" scope="page" class="edu.TeacherBean" />
<title>Insert title here</title>
</head>
<script language="javascript">
<!--
function usercheck(){
var title,content;
title=document.myform.title.value;
content=document.myform.content.value;
if(title==""){
alert("标题不能为空!");
return false;}
if(content==""){
alert("内容不能为空!");
return false;}
}
//-->
</script>
<%
int a_id=0,userid=0,u_id=0;
String title="",sort="",ask_sort="",content="";
try{
userid=Integer.valueOf(session.getAttribute("userid").toString()).intValue();
sort=session.getAttribute("sort").toString();
title=session.getAttribute("title").toString();
content=session.getAttribute("content").toString();
}catch(NullPointerException e){}
try{
ask_sort=request.getParameter("sort");
a_id =Integer.valueOf(request.getParameter("ask_id")).intValue();
u_id =Integer.valueOf(request.getParameter("u_id")).intValue();
}catch(NumberFormatException e){}
boolean allow=false;
if(sort.equals("user")){
allow=user.isallow(u_id)&&!user.isforbid(u_id);
}
if(sort.equalsIgnoreCase("teacher")){
allow=teacher.isallow(u_id);
}
if(sort.equalsIgnoreCase("admin")){
allow=true;
}
if(userid==0||(userid!=u_id&&!sort.equalsIgnoreCase("admin"))||(!sort.equalsIgnoreCase(ask_sort)&&!sort.equalsIgnoreCase("admin"))||!allow)
response.sendRedirect("error.jsp");
String time = java.text.DateFormat.getDateTimeInstance().format(new java.util.Date());
%>
<body>
<div align="center">
<table height="155" width="750" border="0" cellspacing="1"
align="center">
<tr>
<td><iframe name="top" height="155" width="750" scrolling="no"
src="top.jsp" frameborder="0"></iframe></td>
</tr>
</table>
</div>
<FORM method="POST" name="myform" action="Servletask"><input
type="hidden" name="action" value="update"> <input
type="hidden" name="id" value="<%=a_id %>"> <input
type="hidden" name="time" value="<%=time %>">
<div align="center">
<table width="100%" border="0" align="center">
<tr>
<td align="right"> </td>
<td></td>
</tr>
<tr>
<td align="right"> </td>
<td width="81%"><label> 主题: <input name="title"
type="text" id="title" value="<%=title %>" size="60" /> </label></td>
</tr>
<tr>
<td> </td>
<td><input type="hidden" name="content" value='<%=content %>' /><iframe
id="eWebEditor1"
src="editor/eWebEditor.jsp?id=content&style=standard"
frameborder="0" scrolling="no" width="650" height="350"></iframe></td>
</tr>
<tr>
<td> </td>
<td><label> <input type="submit" name="Submit"
onClick="return usercheck()" value="提问" /> <input type="reset"
name="Submit2" value="重置" /> </label></td>
</tr>
</table>
</div>
</FORM>
<div align="center">
<table height="155" width="750" border="0" cellspacing="1"
align="center">
<tr>
<td><iframe name="bottom" height="155" width="750" scrolling="no"
src="bottom.jsp" frameborder="0"></iframe></td>
</tr>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -