<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Server.ScriptTimeOut=5000
dbs="../"
%>
<!--#include file="../inc/config.asp"-->
<!--#include file="uccook.asp"-->
<!--#include file="uc.asp"-->
<!--#include FILE="../inc/UpLoadClass.asp"-->
<!--#include file="../inc/Code2Info.en.asp"-->
<%
dim request2 
'建立上传对象
set request2=New UpLoadClass
'设置为手动保存模式
request2.AutoSave=2
'打开对象，默认为 gb2312 字符集，故没有显示设置
request2.Open()
'对象打开结束
linkname=Replace(Replace(Left(request2.Form("linkname"),100),"<","["),">","]")
linkurl=Replace(Replace(Left(request2.Form("linkurl"),200),"<","["),">","]")
LINKKEY=Replace(Replace(Left(request2.Form("LINKKEY"),3),"<","["),">","]")
if linkname="" then
response.Write "<script >alert('提示：\n\n对不起，请填写友情链接名称！...');history.back(-1);</script>"
response.End()
end if
if linkurl="" then
response.Write "<script >alert('提示：\n\n对不起，请填写友情链接地址！...');history.back(-1);</script>"
response.End()
end if
if LINKKEY="" or IsNumeric(LINKKEY)<>true then
response.Write "<script >alert('提示：\n\n对不起，请选择文字链接还是图片链接！...');history.back(-1);</script>"
response.End()
end if
'图片上传写入
request2.FileType="gif/jpg"
request2.MaxSize=1536000
request2.SavePath="../UpLoadUC/"
if request2.Save("linkpic",0) then
	linkpic=request2.Form("linkpic")
end if
if LINKKEY=2 then
if linkpic="" then
response.Write "<script >alert('提示：\n\n对不起，友情链接图片！...');history.back(-1);</script>"
response.End()
end if
end if
''开始写入数据
set rs=Server.CreateObject("Adodb.Recordset")
	sql="select * from H_Link"
	rs.open sql,conn,1,3
	rs.addnew
	rs("linkurl")=linkurl
	rs("linkname")=linkname
	rs("linkpic")=linkpic
	rs("LINKKEY")=LINKKEY
	rs("RDate")=now()
	rs.update
	rs.close
	set rs=nothing	
	response.Write "<script >alert('提示：\n\n添加成功,立即返回...');location.href='mylink.asp';</script>"
	response.End()
	'释放上传对象
	set request2=nothing
%>