📄 mymanager.jsp
字号:
<%@ page language="java" import="java.util.*,java.sql.*,java.io.*" pageEncoding="UTF-8"%>
<%String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<%
if((String) session.getAttribute("login") == null) {
response.sendRedirect("Login.jsp");
}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>梦境电子相册下载照片</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body style="BACKGROUND: #000000" onload="onload=init()">
<P>
<BR>
<center>
<FONT color="#0000ff" size="5">欢迎光临我的电子相册网</FONT>
</center>
</P>
<P>
<BR>
<FONT color="#ff0080">欢迎你,<%=session.getAttribute("id")%></FONT>
</P>
<FONT color="#ff0080"><A href='Index.jsp'><FONT color="#23ded5">首页 </FONT></A><FONT color="#23ded5"> </FONT></FONT>
<A href="LookPicture.jsp?number=0"> <FONT color="#23ded5">自动播放</FONT></A>
<FONTcolor ded5="">
<FONT></FONT>
<A href="Upload.jsp"><FONT color="#23ded5"> 照片上传</FONT></A>
<FONT color="#23ded5"> </FONT>
<A href="PicturedirtypeManager.jsp"><FONT color="#23ded5">相册管理</FONT></A>
<DIV class=ttl1 id=ttl0>
<SPAN class=ttl1></SPAN>
</DIV>
</P>
<br>
<%
try {
String dir[] = new String[1000];
String myid=(String)(session.getAttribute("id"));
int total = 0;
Class.forName("com.mysql.jdbc.Driver");
Connection c = DriverManager
.getConnection("jdbc:mysql://localhost/myphone?user=root&password=123456"); // 连接mysql数据库
Statement s = c.createStatement();
Statement t = c.createStatement();
String sql="select DirName from userdir where ID='"+myid+"'";
System.out.println(sql);
ResultSet r = s.executeQuery(sql);
int k = 0;
while(r.next())
{
dir[k] = r.getString(1);
k++;
}
s.close();
System.out.println(dir[0]);
System.out.println("dir1"+dir[1]);
String filename[][] = new String[1000][6];
int i,j;
for(j = 0; j < k; j+=3)
{
%> <%
for(i = j;i < k && i < j+3 ; i++)
{
String psql = "select * from picture where ID='"+myid+"' and dirname='" + dir[i]+"' order by time";
ResultSet pr = t.executeQuery(psql);
int ss = 0;
while(pr.next())
{
filename[i][ss] = pr.getString(2);
if(ss >= 4 )
break;
System.out.println(pr.getString(1));
ss++;
%>
<FONT color="#ff0080"><IMG name="myPicture" src='C:\test\<%=session.getAttribute("id")%>\<%=dir[i] %>\<%=pr.getString(2) %>' width="40px" height="30px"></FONT>
<% }
%>
<%
}
%>
<br>
<%
for(i = j; i < k && i < j+3 ;i++)
{
%>
<FONT color="#ff0080"><a href="showdirpicture.jsp?dir=<%=dir[i] %>&number=0"><FONT color="#ff0080">相册:<%=dir[i] %></FONT></a>
<%
}
%>
<br>
<br>
<br>
<br>
<%
}
t.close();
} catch (Exception e) {
e.printStackTrace();
}
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -