上传图片加图片水印功能

上传图片加图片水印功能

求助:上传图片加图片水印功能
本帖最后由 hackft 于 2015-04-03 09:28:32 编辑
这是代码,求会的人,帮加一下,先谢谢了
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="dbconn2.asp"-->
<!--#include file="session.asp"-->
<!--#include file="uploadclass.asp"-->
<!--#include file="function2.asp"-->
<%
fn=request.QueryString("fn")      '刚上传的文件名
fnlist=request.QueryString("fnlist") '已上传列表
zt=request.QueryString("zt") '当前状态
'处理删除
if zt="3" then 
'删除图片
delarr=split(fnlist,",")
delnum=ubound(delarr)
newfnlist=""
if delnum>0 then
for jj=0 to delnum
if delarr(jj)<>fn then
newfnlist=newfnlist&","&delarr(jj)
end if
next
newfnlist=mid(newfnlist,2,len(newfnlist))
end if
fnlist=newfnlist
call delfile("../fyimg/"&fn)
'删除房源图对应表单项相应值
call delhiddeninputvalue("csfyt",newfnlist) 
end if

'处理上传
if zt="1"  then '上传数据准备好了,但正准备提交
Server.ScriptTimeOut=5000
set request2=New UpLoadClass
request2.maxsize=307200   '限制小于300kb
request2.savepath="../fyimg/"
request2.FileType="gif/jpg"
request2.Open()
if request2.error=0 then
fn=trim(request2.form("file1"))'上传后的文件名
if fn<>"" then
'成功上传
if trim(fnlist)="" then
fnlist=fn
call addhiddeninputvalue("csfyt",fn) '添加到上传表单
else
fnlist=fnlist&","&fn
call addhiddeninputvalue("csfyt",","&fn) '添加到上传表单
end if
else
call show_go("上传不成功","fyt_sc.asp?zt=0&fnlist="&fnlist)
end if
else
call show_go("上传失败,\n\n请检查文件是否小于300KB,且类型为gif|jpg","fyt_sc.asp?

zt=0&fnlist="&fnlist)
end if
set request2=nothing
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-

transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
font-size: 12px;
color: #FF0000;
}
a {
font-size: 12px;
}
body,td,th {
font-size: 12px;
}
-->
</style>
</head>

<body>
<%
fnlistarr=split(fnlist,",")
fnlistnum=ubound(fnlistarr)
if fnlistnum=3 then
zt="4"
else
zt="0"
end if
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
<%if zt="0" then%>
<td width="350">
<form action="?zt=1&fnlist=<%=fnlist%>" method="post" enctype="multipart/form-data" 

name="form1" id="form1">
  <input name="file1" type="file" id="file1" size="20" />
  <input type="submit" name="Submit" value="提交" />
</form>
</td>
<%end if%>
<td width="639">&nbsp;
<%
for xx=0 to fnlistnum
response.Write("[<a href=""fyt_sc.asp?fn="&fnlistarr(xx)

&"&zt=3&fnlist="&fnlist&""">删除</a>"&fnlistarr(xx)&"]")
next
%>
</td>
  </tr>
</table>
</body>
</html>
<%
sub delhiddeninputvalue(obj,newfn)
response.Write chr(13)&"<script language=""javascript1.2"">"&chr(13)
response.write "parent.document.getElementById("""&obj&""").value="""&newfn&""";"&chr(13)
response.Write "</script>"&chr(13)
end sub
sub addhiddeninputvalue(obj,z)
response.Write chr(13)&"<script language=""javascript1.2"">"&chr(13)
response.write "parent.document.getElementById("""&obj&""").value=parent.document.getElementById

("""&obj&""").value+"""&z&""";"&chr(13)
response.Write "</script>"&chr(13)
end sub

%>


这是空间环境 
上传图片加图片水印功能
------解决思路----------------------
http://www.codefans.net/soft/13286.shtml