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

📄 my_news_modify_err_lhl.jsp

📁 用手机浏览的一个类似于聊天室 博克 homepage 等 对这方面有 兴趣的朋友 有所帮助的
💻 JSP
字号:
<%@ page language="java" pageEncoding="EUC-KR"%>
<%@ page import="java.io.*,java.text.*,java.util.Date,java.util.Vector, java.sql.*, com.entaz.lib.db.*, com.entaz.relay.net.* "%>
<%@ include file="../imgpath.jsp"%>
<%@ include file="appConstants.jsp"%>
<%@ include file="formatUtil.jsp"%>
<%@ include file="../common_func.jsp"%>
<%@ include file="../makeKOR.jsp"%>

<%
	String dispatch = request.getParameter("dispatch");
	int idxNsNews = Integer.parseInt(request.getParameter("idxNsNews"));
	//int idxNsNewsRE = Integer.parseInt(request.getParameter("idxNsNewsRE"));
	String gphone = request.getParameter("gphone");
	String mphone = request.getParameter("mphone");
	
	Connection con = null;
	PreparedStatement pstmt	= null;
	Statement stmt = null;
	ResultSet rs = null;
	
	String usernickname = "No name";
	
	String bgColor = "";
	
	//String urlUpdate = "my_news_register_view_lhl.jsp?idxNsNews="+idxNsNews+"&mphone="+mphone+"&gphone="+gphone;
	String urlUpdate = "my_news_view_lhl.jsp?idxNsNews="+idxNsNews+"&gphone="+gphone+"&mphone="+mphone;
	String urlDelete = "my_news_list_lhl.jsp?mphone="+mphone+"&gphone="+gphone;
	
	try {
%>
<%@ include file="../getConnection.jsp"%>
<%@ include file="bgColor.jsp"%>
<%
		bgColor = mainBgColor;
		
		
		String nicknameString = "SELECT * FROM gt_user_info WITH (READUNCOMMITTED) WHERE phonenum=?";
		pstmt = con.prepareStatement(nicknameString);
		pstmt.setString(1, getStr(gphone));
		rs = pstmt.executeQuery();
		while(rs.next())
		{
			usernickname = rs.getString("nickname");
		}
		
		
		
		if(dispatch.equals("update"))
		{
			int kind = Integer.parseInt(request.getParameter("kind"));
			String title = java.net.URLDecoder.decode(makeKOR(request.getParameter("title")));
			String text = java.net.URLDecoder.decode(makeKOR(request.getParameter("text")));
			
			//System.out.println("============ title.length()=" + title.length());
			//System.out.println("============ text.length()=" + text.length());
			
			if(title.length()>0 && title.length()<=30 && text.length()>0 && text.length()<=800)
			{
				
				String updateString = "UPDATE gt_nsnews SET kind=?,title=?,text=? WHERE idx=?";
				pstmt = con.prepareStatement(updateString);
				pstmt.setInt(1,kind);
				pstmt.setString(2, title);
				pstmt.setString(3, text);
				pstmt.setInt(4, idxNsNews);
				pstmt.executeUpdate();
				
				pstmt.close();
				con.close();
				response.sendRedirect(urlUpdate);
				//request.getRequestDispatcher(urlUpdate).forward(request,response);
			}
			else
			{
				
%>
<html>
<head>
<title>My News Register Err</title>
<link rel="stylesheet" href="../mobile.css" type="text/css"></link>
</head>
<body>
	
<table width="176" border="0" cellspacing="0" cellpadding="0">
	<!-- 鸥捞撇 矫累 -->
	<tr>
		<td>
			<table width="176" border="0" cellspacing="0" cellpadding="0">
				<tr height="19">
					<td width="8" bgcolor="<%=bgColor%>"></td>
					<td bgcolor="<%=bgColor%>"><font color="#ffffff">舅覆芒</font></td>
				</tr>
			</table>
		</td>
	</tr>
	<!-- 鸥捞撇 场 -->

	<!-- 咯归 矫累 -->
	<tr height="8">
		<td></td>
	</tr>
	<!-- 咯归 场 -->

	<!-- 冠胶 矫累 -->
	<tr>
		<td>
			<table width="176" border="0" cellspacing="0" cellpadding="0">
				<tr height="3">
					<td colspan="3" bgcolor="#dae6e8"></td>
				</tr>
				<tr height="18">
					<td bgcolor="#dae6e8" width="3"></td>
					<td></td>
					<td bgcolor="#dae6e8" width="3"></td>
				</tr>
				<tr>
					<td bgcolor="#dae6e8" width="3"></td>
					<td align="center">
						涝仿俊 坷幅啊 乐嚼聪促.<br>
						促矫 涝仿秦林技夸.<br>
					</td>
					<td bgcolor="#dae6e8" width="3"></td>
				</tr>
				<tr height="18">
					<td bgcolor="#dae6e8" width="3"></td>
					<td></td>
					<td bgcolor="#dae6e8" width="3"></td>
				</tr>
				<tr height="3">
					<td colspan="3" bgcolor="#dae6e8"></td>
				</tr>
			</table>
		</td>
	</tr>
	<!-- 冠胶 场 -->

	<!-- 咯归 矫累 -->
	<tr height="4">
		<td></td>
	</tr>
	<!-- 咯归 场 -->
	
	
	<!-- 滚瓢 矫累 -->
	<tr> 
		<td>
			<table width="176" border="0" cellspacing="0" cellpadding="0">
				<tr height="16">
					<td></td>
					<td width="72" bgcolor="<%=bgColor%>" align="center" ><a href="javascript:history.back();"><font color="#ffffff">犁涝仿</font></a></td>
					<td width="2"></td>
					<td width="72" bgcolor="<%=bgColor%>" align="center" ><a href="my_news_list_lhl.jsp?gphone=<%=gphone%>&mphone=<%=mphone%>"><font color="#ffffff">弥家</font></a></td>
					<td></td>
				</tr>
			</table>
		</td>
	</tr>
	<!-- 滚瓢 场 -->
	
	<!-- 咯归 矫累 -->
	<tr height="53">
		<td></td>
	</tr>
	<!-- 咯归 场 -->
<%
String step1=url_path+"/main.jsp?mphone="+mphone+"&gphone="+gphone;//权
String step2=url_path+"/mypage/my_confirm.jsp?mphone="+mphone+"&gphone="+gphone;
String step3=url_path+"/news/NewsMain.jsp?mphone="+mphone+"&gphone="+gphone;
%>
	<!--版肺钎矫 矫累-->
	<tr>
		<td>
			<table width="176" border="0" cellspacing="0" cellpadding="0">
				<tr height="15">
					<td width="8" bgcolor="#BBC7C8"></td>
					<td bgcolor="#DAE6E8">
						&nbsp;<a href="<%=step1%>">权</a>&gt;<a href="<%=step2%>"><%=usernickname%>丛狼 迄乔</a>&gt;<a href="<%=step3%>">春胶</a>&gt;舅覆芒
					</td>
					<td width="8" bgcolor="#BBC7C8"></td>
				</tr>
			</table>
		</td>
	</tr>
	<!--版肺钎矫 场-->
</table>
<%@ include file="../newbottom.jsp"%>
</body>
</html>
<%
			}
		}
		else
		{
			
			String deleteNsNewsString = "DELETE FROM gt_nsnews WHERE idx=?";
			pstmt = con.prepareStatement(deleteNsNewsString);
			pstmt.setInt(1, idxNsNews);
			pstmt.executeUpdate();
			
			String deleteNsNewsREString = "DELETE FROM gt_nsnewsre WHERE ref_idx=?";
			pstmt = con.prepareStatement(deleteNsNewsREString);
			pstmt.setInt(1, idxNsNews);
			pstmt.executeUpdate();
						
			pstmt.close();
			con.close();
			request.getRequestDispatcher(urlDelete).forward(request,response);
		}
	}
	catch(Exception e)
	{
		e.printStackTrace();
	}
	finally
	{
		if(rs != null) try{ rs.close(); }catch(Exception se){se.printStackTrace();}
		if(pstmt != null) try{ pstmt.close(); }catch(Exception se){se.printStackTrace();}
		if(stmt != null) try{ stmt.close(); }catch(Exception se){se.printStackTrace();}
		if(con != null) try{ con.close(); }catch(Exception se){se.printStackTrace();}
	}
%>

⌨️ 快捷键说明

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