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

📄 addpic.asp

📁 西风班级信息管理系统 v1.1的源码
💻 ASP
字号:
<!--#include file="syssetup.asp"-->
<!--#include file="inc/func.INC"-->
<!--#INCLUDE FILE="char.asp" -->
<!--#include file="inc/chkonline.asp"-->
<%call online()%>
<%
userid=session("myuserid")
password=session("mypwd")
if isuser(userid,password)=0 then
%>
<script>
alert("你还没有登录,无权进入!");
parent.location.href="index.asp";
</script>
<%
else
%>
<html>
<head>
<title>上传图片</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="jscs/css.CSS" type=text/css rel=stylesheet>
<script language="JavaScript" src="jscs/jsfun.js"></script>
</head>
<%
MaxPhotoSize=clng(65535*2+2)
photopath="photo/"
if request("action")="全部删除" then
	'call alldelete()
elseif request("action")="删除所选"then
	'call seldelete()
elseif request("action")="上传照片" then
	call upform()
elseif request("action")="upload" then
	call uploadphoto()
else
	'call showalbum()
end if
%>
<body topmargin=0>
<%bgcolor="#CED8CA"%>
<!--#include file="header.inc"-->
<script language="VBScript" src="jscs/LOAD.JS"></script>
<br>
<TABLE width='98%' border=0 align="center" cellPadding=0 cellSpacing=0>
  <TBODY>
  <TR><!--class_albumleft.inc-->
    <TD vAlign=top width=24 background="IMAGES/bg1.gif" 
    height="100%"><BR><BR><BR><BR><BR><BR><IMG src="IMAGES/alumni1.gif" width="24" height="210" align="top"><img src="IMAGES/corner1.gif" width="24" height="179"> </TD>
    <TD vAlign=top align=middle width=66 background="IMAGES/bg2.gif" 
    height="100%"><div align="center"><IMG src="IMAGES/class_album1.gif" width="67" height="159"><IMG src="IMAGES/album_idxbtn.gif" width="31" height="31" vspace=6 border=0><BR>
          <a href="showpic.asp"><FONT color=#ffff99>相册首页</FONT></a><BR>
          <IMG src="iMAGES/addpic_btn.gif" width="31" height="31" vspace=6 border=0><BR>
          <a href="addpic.asp"><FONT color=#ffff99>上传图片</FONT></a><BR>
          <IMG src="IMAGES/album_manbtn.gif" width=31 vspace="6"><br>
          <FONT color=#ffff99>相册管理</FONT><BR>
          <IMG src="IMAGES/back_btn.gif" width=31 vspace=6 border=0><BR>
          <a href="main.asp"><FONT color=#ffff99>返回班级</FONT></a> </div></TD><!--end class_albumleft.inc-->
    <TD width=680 vAlign=top bgcolor="#F1EFD9">
      <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD bgColor=#b23f3c height=2></TD></TR></TBODY></TABLE>
        <TABLE width="70%" border=0 align="center" cellPadding=1 cellSpacing=0 bgcolor="#F1EFD9">
          <TBODY>
            <TR> 
              
              <TD align=middle width=662 bgColor=#F1EFD9>
<%
sub uploadphoto()
dim upload,file
Dim fso
%>
<!--#INCLUDE file="inc/UPLOAD.INC" -->
<%

set upload=new upload_5xSoft

if upload.form("remark")="" then
	Errmsg=Errmsg+"请输入图片名称.\n"
	founderr=true
else
remark=trim(upload.form("remark"))
remark=replace(remark,"'","''",1)
remark=replace(remark,"<","〈",1)
remark=replace(remark,">","〉",1)
remark=replace(remark,chr(13)&chr(10),"<br>",1)
	
end if

if upload.form("detail")="" then
	Errmsg=Errmsg+"请输入图片说明.\n"
	founderr=true
else
	detail=trim(upload.form("detail"))
	detail=replace(detail,"'","''",1)
detail=replace(detail,"<","〈",1)
detail=replace(detail,">","〉",1)
detail=replace(detail,chr(13)&chr(10),"<br>",1)
end if
pictype=upload.form("pictype")
'response.write pictype
'response.end
set file=upload.file("UpFile") 

fileExt=lcase(right(file.filename,4))
if file.filesize<100 then
	Errmsg=Errmsg+"请先选择你要上传的文件.\n"
	founderr=true
elseif fileEXT<>".gif" and fileEXT<>".jpg" then
	Errmsg=Errmsg+"所要上传文件的格式错误!.\n"
	founderr=true
elseif file.filesize>MaxPhotoSize then
 	Errmsg=Errmsg+"文件大小超过了"&MaxPhotoSize/1024&"K限制.\n"
	founderr=true
end if 

if founderr=true then
	call error(errmsg,"javascript:history.back()")
	exit sub
end if

'set fso = CreateObject("Scripting.FileSystemObject")
'path=server.mappath(PhotoPath)
'if fso.folderexists(path)=false then
	'fso.createfolder(path)
'end if
'set fso=nothing

if right(PhotoPath,1)<>"/" then 
	PhotoPath=PhotoPath&"/" 
end if

datetime=year(date)&month(date)&day(date)&hour(now)&minute(now)&second(now)
filename=datetime&file.FileName
file.SaveAs Server.mappath(PhotoPath&FileName)


Set rs = Server.CreateObject("ADODB.Recordset")
rs.open "classpic",conn,1,3
rs.addnew
	rs("filename")=filename
	rs("filesize")=file.filesize
	rs("type")=pictype
	rs("datetime")=now()
	rs("name")=userid
	rs("remark")=remark
	rs("detail")=detail
	rs.update
rs.close

stitle="上载照片"
smsg="您的照片已经成功上载,并收藏在您的班级相册中。"
call success(stitle,smsg,"showpic.asp")
set file=nothing
set upload=nothing 
 
end sub%>
<%sub upform()
	StrSQL = "select truename from txluser where userid='"&userid&"'"
	set rs=conn.execute(StrSQL)
%>

<!--#INCLUDE file="inc/sendnow.inc" -->

<div id="sponsorAdDiv" style="visibility:hidden">
<table width="300" height="50" border=1 cellspacing=1 bordercolor="#000000" bgcolor="#CED8CA"><tr><td>
<table width="100%" height="100%"  border=0 cellspacing=0><tr bgcolor="#F1EFD9"><td>
&nbsp;&nbsp;&nbsp;&nbsp;正在上传图片,请稍候......
</td></tr></table></td></tr></table></div> 

				
                <table width="75%" border="0" align="center" cellspacing="1">
                        <tr> 
                          <td height="449" align="center" valign="middle"><br>
                            <form name="frmupload" action="addpic.asp?action=upload" method="post"  enctype="multipart/form-data" onsubmit="submitonce(this);initAd();">
                              
                        <table width="470" border="0" align="center" cellpadding="4" cellspacing="1"
          bgcolor="#CED8CA">
                          <tr bgcolor="#F1EFD9"> 
                            <td height="20" colspan=2 align="center"> <IMG SRC="IMAGES/upload.gif" WIDTH="149" HEIGHT="36" BORDER=0 ALT=""></td>
                          <tr  bgcolor="#CED8CA"> 
                            <td height="13" colspan=2><table width=100% border=0 cellspacing=16>
                                <tr> 
                                  <td><FONT color=#284654><SPAN 
            style="FONT-SIZE: 9pt"><b>注意事项:</b><BR>
                                    1. 请不要在此发布违反计算机信息网络安全相关条例的有害信息,一经发现,后果自负!<BR>
                                    2. 请不要在此发布和与本站内容无关的照片(如卡通、壁纸、电影剧照、海报、明星、球星、宠物、植物等),一经发现,立即删除。<BR>
                                    3. 仅接受.jpg 和.gif格式的图片,且文件名必须以.jpg或.gif为后缀,大小不超过<font color=brown><%=MaxPhotoSize/1024%>K</font>字节。<BR>
                                    </SPAN></FONT></td>
                                </tr>
                              </table></td>
                          </tr>
                          <tr  bgcolor="#CED8CA"> 
                            <td height="13" width=100 align=right>提 供 者&nbsp;</td>
                            <td> &nbsp;&nbsp;&nbsp;<%=rs("truename")%></td>
                          </tr>
                          <tr bgcolor="#CED8CA"> 
                            <td height="13" align=right>照片名称&nbsp;</td>
                            <td>&nbsp;&nbsp;
                              <input size="15" name="remark" maxlength=30>
                              (不超过15个字) </td>
                          </tr>
                          <tr bgcolor="#CED8CA"> 
                            <td height="13" align=right>照片说明&nbsp;</td>
                            <td>&nbsp;&nbsp; <input size="41" name="detail" maxlength=50></td>
                          </tr>
                          <tr bgcolor="#CED8CA"> 
                            <td height=13 align=right>照片位置&nbsp;</td>
                            <td>&nbsp;&nbsp; <INPUT 
            type=file size=30 name=UpFile></td>
                          </tr>
                          <tr bgcolor="#CED8CA"> 
                            <td height="13" align=right>照片类型&nbsp;</td>
                            <td>&nbsp;&nbsp; <select name=pictype>
                                <option value=校园风光>&nbsp;校园风光&nbsp;</option>
                                <option value=同学合影>&nbsp;同学合影&nbsp;</option>
                                <option value=个人照片>&nbsp;真我风采 &nbsp;</option>
                                <option value=其它照片>&nbsp;其它照片&nbsp;</option>
                              </select> <input type=hidden name=test value=test></td>
                          </tr>
                          <tr  bgcolor="#CED8CA"> 
                            <td height="13" colspan=2><table width=100% cellspacing=13>
                                <tr> 
                                  <td>如果你的图片文件较大或网络速度太慢,上载过程可能要一段时间,请耐心等待!</td>
                                </tr>
                              </table></td>
                          </tr>
                          <tr bgcolor="#F1EFD9"> 
                            <td height="30" colspan=2 align="center"><div align="center"> 
                                <input style="WIDTH: 90px; HEIGHT: 20px" type="submit" value="开始上载" name="upsubmit">
                              </div></td>
                          </tr>
                        </table>
                            </form></td>
                        </tr>
                      </table>
</td></tr></table>
<%end sub%>
<%call upform()%>
              </TD>
              <TD width=6 bgColor=#9a9e8a></TD>
            </TR>
          </TBODY>
        </TABLE></TD></TR></TBODY></TABLE>
<TABLE width=98% border=0 align="center" cellPadding=0 cellSpacing=0>
  <TBODY>
  <TR>
    <TD bgColor=#9a9e8a height=3></TD></TR></TBODY></TABLE>
</body>
<!--#include file="inc/footer.inc"-->
</html>
<%end if%>

⌨️ 快捷键说明

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