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

📄 photo.asp

📁 用JAVA编写的网络留言簿。前台功能 一、用户注册/注册资料修改。 二、签写留言
💻 ASP
字号:
<!--#include file="session.asp"-->
<!--#include file="conn.asp"-->
<!--#Include file="const.asp"-->
<!--#include file="float.asp"-->
<%action=request("action")
pageno=request("pageno")%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>图片上传-<%=webname%></title>
<link href="css.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
<!--
function go(src,q)
    {
      var ret;
      ret = confirm(q);
      if(ret!=false)window.location=src;
    }
//-->
</script>
<script language="JavaScript">
function checkform(){
if (document.form1.phototitle.value.length==0){
	alert("图片标题不能为空!");
	document.form1.phototitle.focus();
	return false;
	}
if (document.form1.photo.value.length==0){
	alert("图片地址不能为空!");
	document.form1.photo.focus();
	return false;
	}
if  (document.form1.photocomment.value.length>200) {
	alert("您发表的留言大于所规定字数!");
	document.form1.photocomment.focus();
	return false;
	}}
</script>
<script language="JavaScript">
function checkform2(){
if (document.form2.phototitle.value.length==0){
	alert("图片标题不能为空!");
	document.form2.phototitle.focus();
	return false;
	}
if  (document.form2.photocomment.value.length>200) {
	alert("您发表的留言大于所规定字数!");
	document.form2.photocomment.focus();
	return false;
	}}
</script>
</head>
<body bgcolor="<%=bgcolor%>" text="#000000" leftmargin="0" topmargin="1" onload="window.setTimeout('statusScroll()', 500)">
<script language="JavaScript">
var msg = "<%=webname%>留言板"
var speed = 300; 
var msgud = " " + msg; 
function statusScroll() { 
if (msgud.length <msg.length) msgud += " - " + msg; 
msgud = msgud.substring(1, msgud.length); 
window.status = msgud.substring(0, msg.length);
window.setTimeout("statusScroll()", speed); 
} 
</SCRIPT>
<!--#include file="top.asp"-->
<%if action="upload" and session("photoflag")="1" then%>
<table width="680" border="0" align="center" cellspacing="1" bgcolor="<%=tabbgcolor%>">
  <tr> 
    <td bgcolor="<%=tdbgcolor%>"><table width="100%" height="20" border="0">
        <tr>
          <td><div align="right"><a href="javascript:history.go(-1);" onFocus="if(this.blur)this.blur()"><img src="images/Refresh.gif" width="14" height="14" border="0" align="absbottom">返回照片欣赏</a>   &nbsp;</div></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td bgcolor="<%=tdbgcolor%>">
	<table width="100%" border="0">
        <form name="form1" enctype="multipart/form-data" id="form1" method="post" action="photoupload.asp" onSubmit="javascript:return checkform()">
          <tr> 
            <td width="22%" valign="top"> <div align="right"><br>
                照片标题:<br>
                <br>
                <br>
                照片路径:<br>
                <br>
                <br>
                <br>
                <br>
                说明 : </div></td>
            <td width="62%">   <br>
                 
              <input name="phototitle" type="text" height="15" id="phototitle" size="20">
              <span class="red">**</span><br> <br>
                 
              <input name="photo" type="file" height="20"id="photo" size="20">
              <span class="red"> **</span><br> <br>
                 
              <textarea name="photocomment" cols="45" rows="10" wrap="VIRTUAL" id="photocomment"></textarea> 
              <br>
              <br>
            </td>
            <td width="16%"> <input name="Submit" type="submit" id="Submit" value="上 传">
              <br> 
              <br>
              <br>
              <br> 
        <input name="Submit2" type="button" id="Submit" value="返 回" onClick="javascript:history.go(-1);">
			   </td>
          </tr>
        </form>
      </table></td>
  </tr>
</table>
<%elseif action="edit" and session("photoflag")="1" then
phototitle=request("phototitle")
photoid=request("photoid")
photocomment=request("photocomment")
%>
<table width="680" border="0" align="center" cellspacing="1" bgcolor="<%=tabbgcolor%>">
  <tr> 
    <td bgcolor="<%=tdbgcolor%>"><table width="100%" height="20" border="0">
        <tr> 
          <td><div align="right"><a href="javascript:history.go(-1);" onFocus="if(this.blur)this.blur()"><img src="images/Refresh.gif" width="14" height="14" border="0" align="absbottom">返回照片欣赏</a>   &nbsp;</div></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td bgcolor="<%=tdbgcolor%>"> <table width="100%" border="0">
        <form name="form2" id="form2" method="post" action="edit.asp" onSubmit="javascript:return checkform2()">
          <tr> 
            <td width="22%" valign="top"> <div align="right"><br>
                照片标题:<br>
                <br>
                <br>
                <br>
                <br>
                <br>
                说明 : </div></td>
            <td width="62%">   <br>
                 
              <input name="phototitle" type="text" id="phototitle" value="<%=phototitle%>" size="20" height="15">
              <span class="red">**</span><br> <br>
                 <br>
              <textarea name="photocomment" cols="45" rows="10" wrap="VIRTUAL" id="photocomment"><%=photocomment%></textarea> 
              <br> <br> </td>
            <td width="16%"> <input name="Submit" type="submit" id="Submit2" value="更 新"> 
              <br> <br>
              <input name="photoid" type="hidden" id="photoid" value="<%=photoid%>"> <br> <br> 
              <input name="Submit2" type="reset" id="Submit2" value="重 置"> 
            </td>
          </tr>
        </form>
      </table></td>
  </tr>
</table>
<%else%>
<table width="680" border="0" align="center" cellspacing="1" bgcolor="<%=tabbgcolor%>">
  <tr> 
    <td height="22" colspan="2" bgcolor="<%=tdbgcolor%>"> 
      <div align="right">
        <table width="100%" height="20" border="0">
          <tr>
            <td> <div align="right"><%if photoup=1 then
			    if session("photoflag")="1" then%><a href="photo.asp?action=upload" onFocus="if(this.blur)this.blur()"><img src="images/up.gif" width="16" height="14" border="0" align="absmiddle">上传照片</a>    &nbsp;</div>
			    <%else%>
			    对不起,你不具有上传的权限
			    <%end if%>
			<%else%>
			对不起,上传功能已关闭
			<%end if%></td>
          </tr>
        </table>
	</td></tr>
<tr>
    <td bgcolor="<%=tdbgcolor%>"> 
      <%sql="select * from [photo] order by photoid desc"
rs.open sql,conn,1,1
if not rs.eof then%>
      <table width="100%" border="0" cellspacing="1" bgcolor="<%=tdbgcolor%>">
        <%rs.pagesize=8
if request("pageno")="" then
    rs.absolutepage=1
else
rs.absolutepage=pageno
end if
pageno=rs.absolutepage
lineno=1
do while not rs.eof and lineno<=rs.pagesize%>
        <tr> 
<%for i=1 to 4
if rs.eof then exit do%>
    <td  height="174" bgcolor="<%=tdbgcolor%>"><div align="center"><a href="photoview.asp?photoname=<%=rs("photoname")%>&photocomment=<%=rs("photocomment")%>&phototitle=<%=rs("phototitle")%>" target="_blank" onFocus="if(this.blur)this.blur()"><img src="photo/<%=rs("photoname")%>" width="100" height="100" border="0" title="<%=rs("photocomment")%>"></a><br>
              <br>
              标题:<%=rs("phototitle")%> 
              <%if session("username")=rs("photouser") or session("flag")=0 then%>
              <a href="?action=edit&phototitle=<%=rs("phototitle")%>&photoid=<%=rs("photoid")%>&photocomment=<%=rs("photocomment")%>" onFocus="if(this.blur)this.blur()"><img src="images/edit.gif" width="12" height="14" border="0" align="baseline"></a> 
              <%end if%>
              <%if session("flag")<"2" and session("flag")>"-1" and session("username")<>"" then%>
              <a href='javascript:go("photodel.asp?photoid=<%=rs("photoid")%>","您确定要删除此图片?")' onFocus="if(this.blur)this.blur()"><img src="images/del.gif" width="9" height="9" border="0"></a> 
              <%end if%>
              <br>
        上传人:<%=rs("photouser")%></div></td>
<%lineno=lineno+1
rs.movenext
next%><br><br>
  </tr>
<%loop%>
        </table>
<%else%>
        
      <table width="100%" border="0" align="center">
        <tr>
          <td height="174"> 
            <div align="center">还没有照片</div></td>
  </tr>
</table>
      <%end if%>
    </td>
  </tr>
</table>
<table width="680" border="0" align="center" cellspacing="1" bgcolor="<%=td2bgcolor%>">
  <tr>
    <td bgcolor="<%=tdbgcolor%>">
<form action="photo.asp" name="form2">
        <div align="right">第<%=pageno%>/<%=rs.pagecount%>页&nbsp;&nbsp;共<%=rs.recordcount%>张图片&nbsp; 
          <%if pageno>1 then%>
          <a href="?pageno=1" onFocus="if(this.blur)this.blur()">首页</a>&nbsp; 
          <%else%>
          首页&nbsp; 
          <%end if%>
          <%if pageno>1 then%>
          <a href="?pageno=<%=pageno-1%>" onFocus="if(this.blur)this.blur()">上一页</a>&nbsp; 
          <%else%>
          上一页&nbsp; 
          <%end if
		  if pageno<rs.pagecount then%>
          <a href="?pageno=<%=pageno+1%>" onFocus="if(this.blur)this.blur()">下一页</a>&nbsp; 
          <%else%>
          下一页&nbsp; 
          <%end if
		  if pageno<rs.pagecount then%>
          <a href="?pageno=<%=rs.pagecount%>" onFocus="if(this.blur)this.blur()">尾页</a>&nbsp; 
          <%else%>
          尾页&nbsp; 
          <%end if%>
          转到 
          <input name="pageno" type="text" id="pageno" size="1">
          <input type="submit" name="Submit" value="go">
        </div></form></td>
  </tr>
</table>
<%rs.close
set rs=nothing
conn.close
set conn=nothing
end if%>
<table width="680" border="0" align="center" cellspacing="1" bgcolor="<%=tabbgcolor%>">
  <tr>
    <td width="986" bgcolor="<%=td1bgcolor%>"><!--#Include file="buttom.asp"--></td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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