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

📄 info_addsave.jsp

📁 Oracle 10g数据库Java开发 源码
💻 JSP
字号:
<%@ page contentType="text/html;charset=gb2312" %>    
<%@include file="InfoComm.jsp"%>
<%
	// 取得当前用户名
	String sName = (String)session.getValue("user_id");
	String pwd = (String)session.getValue("passwd");

// 只有系统用户才可以有权限
if(IsUser(sName,pwd))
{
%>
<%!
	String infoTitle,strContent,strCateId,strPic="0",sPoster;
	int cateid,attpic;
%>
<%
//判断用户权限,是否可以维护信息
try
{
	infoTitle = request.getParameter("txttitle");
	strPic = request.getParameter("attpic");
	if(strPic==null)
		attpic = 0;
	else
		attpic = 1;
	strContent = request.getParameter("txtcontent");
	strCateId = request.getParameter("cate");
	cateid = Integer.parseInt(strCateId);
	String ss = replaceString(strContent,"\r\n","<br>");
	ss = replaceString(ss," ","&nbsp;");

	//插入信息
	Information o_Info = new Information();
	o_Info.setInfoId(o_Info.getMaxId()+1);
	o_Info.setContent(ss);
	o_Info.setCateId(cateid);
	o_Info.setPoster(sName);
	o_Info.setTitle(infoTitle);
	o_Info.setAttpic(attpic);
	o_Info.setHits(0);
	o_Info.CreateInformation();
%>
<html>
<head>
<title>添加信息成功</title>
<link rel="stylesheet" href="../style.css">
</head>
<body>
<div align="center"><center>

<table border="0" cellspacing="0" width="80%" cellpadding="0">
  <tr>
    <td width="100%" bgcolor="#FFCC00" height="20"><p align="center"><font color="#000000"><b>添加信息成功</b></font></td>
  </tr>
  <tr>
    <td width="100%" bgcolor=#fff0b2><p align="left"><br>
    其文章名为:<%=infoTitle%><br>
    提交人:<%=sName%><br>
            
    <p align="center">是否继续添加?<br>
    <br>
	<%
	out.println("<a href='info_add.jsp' onclick='javascript:opener.location.reload();'>是</a>&nbsp;&nbsp;");
	out.println("<a href='javascript:opener.location.reload();window.close();'>否</a>");
	%>
	<br>
    <br>
    </td>
  </tr>
</table>
</center></div>
<%
}catch(Exception e)
	{ System.out.println(e.toString());}
%>
</body>
</html>
<%}
else
	out.println("你没有添加的权限");		
%>

⌨️ 快捷键说明

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