📄 photo_upload.asp
字号:
<!--#include file="conn.asp" -->
<!--#include file="session.asp" -->
<!--#include file="../function/function.asp" -->
<!--#include file="../function/upload_5xsoft.inc" -->
<%
web_id1="../language/"
web_id=web_id1&l_id&"/WELCOM_MSG.ASP"
call include(web_id)
up_money=momey_inof + addphoto_money
update_user=session_cookie_name
call up_money_f(up_money,update_user)
set upload=new upload_5xsoft
phototitle=replace(trim(upload.Form("phototitle")),"'","")
photocomment=replace(trim(upload.Form("photocomment")),"'","")
if phototitle="" then
%>
<script Language="JavaScript">
alert("<%=L_WELCOM_MSG6%>");
window.location="photo_add.asp";
</script>
<%
response.end
end if
set file=upload.file("photo")
fileExt=lcase(right(file.filename,4))
if fileEXT<>".gif" and fileEXT<>".jpg" then
response.write"<script>alert('"&L_WELCOM_MSG7&"');location='"&request.ServerVariables("HTTP_REFERER")&"'</script>"
response.end
end if
if file.fileSize>0 then
''在目录后加(/)
if right(formPath,1)<>"/" then
formPath=photopath&"/"
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "photo",conn,3,3
rs.addnew
vfname = makefilename(now())
fname = vfname & "." & GetExtendName(file.FileName)
file.SaveAs Server.mappath(formPath&fname) ''保存文件
rs("photouser")=session_cookie_name
rs("phototitle")=phototitle
rs("g_id")=session_cookie_gid
rs("photocomment")=photocomment
rs("photoname")=fname
rs("phototime")=now()
rs.update
end if
set file=nothing
set upload=nothing
function makefilename(fname)
fname = now()
fname = replace(fname,"-","")
fname = replace(fname," ","")
fname = replace(fname,":","")
fname = replace(fname,"PM","")
fname = replace(fname,"AM","")
fname = replace(fname,"上午","")
fname = replace(fname,"下午","")
makefilename=fname
end function
function GetExtendName(FileName)
dim ExtName
ExtName = LCase(FileName)
ExtName = right(ExtName,3)
ExtName = right(ExtName,3-Instr(ExtName,"."))
GetExtendName = ExtName
end function
log_url="class_photo.asp"
log_msg=L_WELCOM_MSG8
%><!--#include file="welcom.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -