- <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
- <!-- #include file="inc/conn.asp" -->
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>班级相册</title>
- <script type="text/javascript" src="./KindEditor.js"></script>
- <script type="text/javascript" src="common/common.js"></script>
- <link href="css/layout.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript">
- function CheckForm(){
- if (checkNull(document.getElementById("description"),"图片描述") &
- checkNull(document.getElementById("file"),"上传图片")){
- return true;
- }else{
- return false;
- }
- }
- </script>
- </head>
- <%
- if Session("uid")="" then response.Redirect("login.asp")
- response.Write("<div id=welcome>欢迎你:")
- response.Write(Session("userName"))
- response.Write("</div>")
- id=trim(request("id"))
- if id<>"" then
- sql="delete from album where id="
- conn.execute(sql)
- %>
- <script>
- alert("已经成功删除图片");
- location.replace('album.asp');
- </script>
- <%
- end if
- %>
- <body>
- <iframe src="navigation.asp" width="100%" height="50" scrolling="no" frameborder="0"></iframe>
- <div id="div_bg">
- <div id="top"></div>
- <div id="middle">
- <div id="album_top">
- <form method="post" action="upfile.asp" enctype="multipart/form-data" onsubmit="return CheckForm();">
- 图片描述:<input name="description" id="description" type="text" class="form_text">
- <BR>
- 上传照片:<input id="file" name="file" type="file" class="form_text" style="width:400" value="">
- <input name="go" type="submit" class="form_btn" value="确定上传">
- </form>
- </div>
- <div id="album_pic">
- <%
- set rs=server.CreateObject("adodb.recordset")
- sql="select a.id,a.description,a.fileName,a.uid,a.createTime,b.name,b.uid from album as a,member as b where a.uid=b.uid order by a.createtime desc"
- rs.open sql,conn,1,3
- if rs.eof then
- response.Write("没有相片")
- response.End()
- end if
- rs.pagesize=30
- if rs.eof then
- rs_total=0
- else
- rsrs_total=rs.recordcount
- end if
- page=trim(request("page"))
- mypage=trim(request("mypage"))
- if mypage<>"" then page=clng(mypage)
- if page="" then
- page=1
- else
- page=clng(page)
- if page<1 then page=1
- if page>rs.pagecount then page=rs.pagecount
- end if
- %>
- <table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#FFFFFF">
- <tr>
- <%
- if not rs.eof then
- rs.absolutepage=page
- repeate_rows=0
- while repeate_rows<rs.pagesize and not rs.eof
- %>
- <td width="20%">
- <table width="100%" border="0" cellspacing="1">
- <tr>
- <td bgcolor="#FFFFFF">
- <a href="attached/<%=rs("fileName")%>" target="_blank">
- <img src="attached/<%=rs("fileName")%>" width="100" height="100" border="0" title="<%=rs("description")%>">
- </a>
- </td>
- </tr>
- <tr>
- <td height="26" bgcolor="#f7f7f7">
- <%
- if Session("uid")=rs("uid") then
- %>
- <FONT COLOR="#333333"><%=rs("name")%><a href="#" onclick="if (confirm('确定删除')==true) location.replace('?id=<%=id%>')">[删除]</a></FONT>
- <%
- else
- %>
- <FONT COLOR="#333333"><%=rs("name")%></FONT>
- <%end if%>
- <BR>
- <FONT COLOR="#999999"><%=rs("createtime")%></FONT>
- </td>
- </tr>
- </table>
- </td>
- <%
- rs.movenext
- repeate_rowsrepeate_rows=repeate_rows+1
- if repeate_rows mod 5=0 then
- response.Write("</tr><tr>")
- end if
- wend
- %>
- <%end if%>
- </tr>
- </table>
- <form action="" method="post">
- <table width="90%">
- <tr>
- <td align="right">[<%=page%>/<%=rs.pagecount%>] 每页<%=rs.pagesize%>张 共<%=rs_total%>张图片
- <%if page<>1 then%>
- <a href="?page=1">第一页</a>
- <a href="?page=<%=(page-1)%>">上一页</a>
- <%
- end if
- if page<>rs.pagecount then
- %>
- <a href="?page=<%=(page+1)%>">下一页</a>
- <a href="?page=<%=rs.pagecount%>">最后一页</a>
- <%
- end if
- rs.close()
- set rs=nothing
- %>
- 指定页码:<input name="mypage" type="text" value="" size="2" maxlength="2" />
- <input type="submit" value="go" name="goPage" /></td>
- </tr>
- </table>
- </form>
- </div>
- </div><div id="foot"></div>
- </div>
- <div id="bottom">Copyright © 2008 </div>
- </body>
- </html>
利用化境上传组件上传图片(一)上传页面
最新推荐文章于 2018-10-11 22:01:00 发布