?? addpic.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>
正在上傳圖片,請稍候......
</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>提 供 者 </td>
<td width="344"> <%=rs("truename")%></td>
</tr>
<tr>
<td height="13" align=right width="110">照片名稱 </td>
<td width="344">
<input size="15" name="remark" maxlength=30>
(不超過15個字) </td>
</tr>
<tr>
<td height="13" align=right width="110">照片說明 </td>
<td width="344"> <input size="41" name="detail" maxlength=50></td>
</tr>
<tr>
<td height=13 align=right width="110">照片位置 </td>
<td width="344"> <INPUT
type=file size=30 name=UpFile></td>
</tr>
<tr>
<td height="13" align=right width="110">照片類型 </td>
<td width="344"> <select name=pictype>
<option value=校園風光> 校園風光 </option>
<option value=同學合影> 同學合影 </option>
<option value=個人照片> 真我風采 </option>
<option value=其它照片> 其它照片 </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 + -