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

📄 show.jsp

📁 留言管理系统 用户网络版块的增加
💻 JSP
字号:
<%@ page contentType="text/html;charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="conn.jsp"%>
<%!

public String replstr(String str0,String str1,String str2){
String str3="";
int a0,a1,a3,a4,b;
b=0;
a1=str1.length();
if(str0.indexOf(str1)>-1){
while(str0.indexOf(str1,b)>-1){
a0=str0.length();
if(str0.indexOf(str1)==0){
str0=str2+str0.substring(a1,a0);
}else{
a3=str0.indexOf(str1);
a4=a3+a1;
str0=str0.substring(0,a3)+str2+str0.substring(a4,a0);
b=a3+str2.length()-a1+1;
}
}
}
str3=str0;
return str3;
} 

public String dowith(String str){
str=replstr(str,"\n","</p><p>");
str=replstr(str," ","&nbsp;");
return str;
}
%>
<%
String id=(String)request.getParameter("id");
 password="admin";//管理员密码
String mm=null;mm=(String)session.getAttribute("pass");

if(id==null){ 
out.print("<font color=#FF0000><h3>ERROR!</h3></font>");}else{


String sql="select * from scott.lyb where id='"+id+"'";
ResultSet rs=stmt.executeQuery(sql);
rs.next();

%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>留言内容</title>
<style type="text/css">
<!--
body {
	background-image: url(img/bg.gif);
	margin-top: 0px;
	margin-bottom: 5px;
}
.style2 {color: #FFFFFF}
p{text-indent:22pt;font-size:14px}
td{font-size:14px}
th{font-size:16px}
a:link{text-decoration:none;color:#0000ff}
a:visited{text-decoration:none;color:#0000ff}
a:hover{text-decoration:underline;color:#ff0000}
.l {font-size:13px}
.l a:link{text-decoration:none;color:#0000ff}
.l a:visited{text-decoration:none;color:#0000ff}
.l a:hover{text-decoration:none;color:#ff0000}
.style3 {color: #FF0000}
-->
</style>
</head>

<body>
<table width="780" border="0" align="center" cellspacing="0" rgb(128,128,192)>
  <tr>
    <td height="2"></td>
  </tr>
  <tr>
    <td><img src="img/top.gif" width="778" height="80"></td>
  </tr>
  <tr>
    <td><hr></td>
  </tr>
  <tr>
    <td class="l">&nbsp;<a href="index.jsp">首页</a>  &gt; <span class="style3">留言内容</span></td>
  </tr>
  <tr>
    <td height="10"></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="1" bgcolor="#c1d1c1">
        <tr>
          <td bgcolor=rgb(128,128,192)><table width="100%" border="0" cellspacing="0">
              <tr>
                <td class="l"><div align="right"><a href="index.jsp"><img src="img/back1.jpg" width="69" height="20" border="0" ></a>
                <% if(password.equals(mm)){%><a href="drop.jsp?id=<%=id%>"><img src="img/del1.jpg" width="76" height="21" border="0" ></a>  <% String te="y";if(te.equals(rs.getString(12))){%> <a href="hide.jsp?id=<%=id%>"><img src="img/hide1.jpg" width="76" height="22" border="0" ></a>
                <%}else{%> <a href="showl.jsp?id=<%=id%>"><img src="img/show1.jpg" width="76" height="21" border="0" ></a>
                <% } }else{%>
                <a href="send.jsp"><img src="img/send1.jpg" width="77" height="21" border="0"  ></a> <a href="log.jsp?id=<%=id%>"><img src="img/admin1.jpg" width="77" height="21" border="0" ></a>
                <% }%>&nbsp;&nbsp;</div></td>
              </tr>
          </table></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td height="10"></td>
  </tr>
</table>
<table width="780" border="0" align="center" bgcolor="#F8FFF7" style="BORDER-BOTTOM: #4F7B0D 1px solid; BORDER-LEFT: #4F7B0D 1px solid; BORDER-RIGHT: #4F7B0D 1px solid; BORDER-TOP: #4F7B0D 1px solid">
  <tr>
    <td height="20">
      <table width="100%" border="0" cellspacing="1" bgcolor=rgb(128,128,192)>
        <tr>
          <td width="40%"> &nbsp;&nbsp;<span class="style2"><%=rs.getString(2)%></span></td>
          <td width="60%"><div align="right"><span class="style2"><%=rs.getString(3)%> 发表于:<%=rs.getString(8)%>&nbsp;&nbsp;&nbsp;&nbsp;IP地址:<% if(password.equals(mm)){out.print(rs.getString(7));}else{String str=rs.getString(7);int l=str.lastIndexOf(".");l++; String ip=str.substring(0,l);out.print(ip+"*");}%></span> &nbsp;&nbsp;</div></td>
        </tr>
      </table></td>
  </tr>
  <tr bgcolor="#F8FFF7">
    <td><div align="center">
      <table width="100%" border="0" cellspacing="0">
        <tr>
          <td width="7%"><div align="right">网站:</div></td>
          <td width="33%"><%=rs.getString(5)%></td>
          <td width="9%"><div align="right">Q Q:</div></td>
          <td width="19%"><%=rs.getString(6)%></td>
          <td width="13%"><div align="right">E-mail:</div></td>
          <td width="19%"><%=rs.getString(4)%></td>
        </tr>
      </table>
    </div>      <div align="center"></div>      <div align="center"></div>      <div align="center"></div>      <div align="center"></div></td>
  </tr>
  <tr bgcolor="#F8FFF7">
    <td height="1" background="img/b.gif"></td>
  </tr>
  <tr bgcolor="#F8FFF7">
    <td><table width="97%" border="0" align="center" cellspacing="5">
      <tr>
        <td><p><%=dowith(rs.getString(9))%></p></td>
      </tr>
    </table></td>
  </tr>
  <tr bgcolor="#F8FFF7">
    <td><table width="98%" border="0" align="center" cellspacing="5">
      <tr>
        <td bgcolor=rgb(242,240,251)><table width="100%" border="0" cellspacing="8">
          <tr>
            <td><p><%=dowith(rs.getString(10))%></p></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<% if(password.equals(mm)){%>
<br><form name="form1" method="post" action="actre.jsp">
<table width="780" border="0" align="center" cellspacing="1" bgcolor="#4F7B0D">
  <tr bgcolor=rgb(128,128,192)>
    <td><table width="100%" border="0" cellspacing="1">
        <tr>
          <th bgcolor=rgb(128,128,192)><span class="style2">回 复 留 言</span></th>
        </tr>
    </table></td>
  </tr>
  <tr bgcolor="#EFF3E7">
    <td bgcolor="#EFF3E7"><div align="center">
        <table width="100%" border="0" cellspacing="5">
          <tr>
            <td><div align="center">
                <textarea name="text" cols="100" rows="8" id="text" style="BORDER: #4F7B0D 1px solid; background: #f8fff7;color: #4F7B0D; overflow:auto;"></textarea>
            </div></td>
          </tr>
          <tr>
            <th><input name="imageField" type="image" src="img/ok1.jpg" width="69" height="20" border="0" >
               <input name="id" type="hidden" id="id" value="<%=id%>">
               <a href="http://www.numb1.com"><img src="img/back1.jpg" width="69" height="20" border="0" ></a></th>
          </tr>
        </table>
    </div></td>
    </tr>
</table>
</form><%}%>
<br>
<table width="780" border="0" align="center" cellspacing="1" bgcolor="#4F7B0D">
  <tr>
    <td bgcolor=rgb(128,128,192) class="l"><div align="center" class="style2">&nbsp;&nbsp;<font color="#ffffff">版权所有 &copy;&nbsp;中大科技</font></a></div></td>
  </tr>
</table>
</body>
</html>
<% }%>

⌨️ 快捷键说明

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