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

📄 addpic.asp

📁 学校用的班级网站
💻 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("你还没有登录,无权进入!");
</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(524287*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 BGCOLOR=#CCCCCC topmargin="0" leftmargin="0">

<TABLE WIDTH=409 BORDER=0 CELLPADDING=0 CELLSPACING=0 height="360" bgcolor="#FFFFFF" style="border-collapse: collapse" bordercolor="#111111">
	<TR>
		<TD height="59" width="470">
			<IMG SRC="images/addpic_01.gif" WIDTH=450 HEIGHT=59></TD>
	</TR>
	<TR>
		<TD height="137" background="images/addpic_02.gif" valign="top" width="470">
			<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" height="128">
              <tr>
                <td width="3%" height="20"> </td>
                <td width="90%" height="20"> </td>
                <td width="7%" height="20"> </td>
              </tr>
              <tr>
                <td width="3%" height="96"> </td>
                <td width="90%" height="96">1. 请不要在此发布违反计算机信息网络安全相关条例的有害信息,一经发现,后果自负!<BR>
                                    2. 请不要在此发布和与本站内容无关的照片(如卡通、壁纸、电影剧照、海报、明星、球星、宠物、植物等),一经发现,立即删除。<BR>
                                    3. 仅接受.jpg 和.gif格式的图片,且文件名必须以.jpg或.gif为后缀,大小不超过<font color=brown><%=MaxPhotoSize/1024%>K</font>字节。<BR>
                                    </SPAN></FONT></td>
                <td width="7%" height="96"> </td>
              </tr>
              <tr>
                <td width="3%" height="12"></td>
                <td width="90%" height="12"></td>
                <td width="7%" height="12"></td>
              </tr>
            </table>
        </TD>
	</TR>
	<TR>
		<TD height="164" valign="top" align="center" width="470">
		<%
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,"addpic.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 border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2">
              <tr>
                <td width="100%">
          <form name="frmupload" action="addpic.asp?action=upload" method="post"  enctype="multipart/form-data" onsubmit="submitonce(this);initAd();">
                              
                        <div align="center">
                          <center>
                              
                        <table width="100%" border="0" cellpadding="4" cellspacing="0" style="border-collapse: collapse" >
                      
                          <tr> 
                            <td height="13" width=110 align=right>提 供 者&nbsp;&nbsp; </td>
                            <td width="344"> &nbsp;&nbsp;&nbsp;<%=rs("truename")%></td>
                          </tr>
                          <tr> 
                            <td height="13" align=right width="110">照片名称&nbsp;</td>
                            <td width="344">&nbsp;&nbsp;
                              <input size="15" name="remark" maxlength=30>
                              (不超过15个字) </td>
                          </tr>
                          <tr> 
                            <td height="13" align=right width="110">照片说明&nbsp;</td>
                            <td width="344">&nbsp;&nbsp; <input size="41" name="detail" maxlength=50></td>
                          </tr>
                          <tr> 
                            <td height=13 align=right width="110">照片位置&nbsp;</td>
                            <td width="344">&nbsp;&nbsp; <INPUT 
            type=file size=30 name=UpFile></td>
                          </tr>
                          <tr> 
                            <td height="13" align=right width="110">照片类型&nbsp;</td>
                            <td width="344">&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> 
                            <td height="13" colspan=2 width="100%">
                            <table width=100% cellspacing=3 style="border-collapse: collapse" bordercolor="#111111" cellpadding="0">
                                <tr> 
                                  <td>如果你的图片文件较大或网络速度太慢,上载过程可能要一段时间,请耐心等待!</td>
                                </tr>
                              </table></td>
                          </tr>
                          <tr> 
                            <td height="30" colspan=2 align="center" width="462" bgcolor="#FFFFFF"><div align="center"> 
                                <input style="WIDTH: 90px; HEIGHT: 20px" type="submit" value="开始上载" name="upsubmit">
                              </div></td>
                          </tr>
                        </table>
                            </center>
                        </div>
                            </form>
                </td>
              </tr>
            </table><%end sub%>
<%call upform()%>
        </TD>
	</TR>
</TABLE>

</BODY>
</HTML>
<%end if%>

⌨️ 快捷键说明

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