asp无组件上传中的问题???请高手帮帮忙??(急急急)

来源:百度知道 编辑:UC知道 时间:2024/05/03 08:08:49
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!-- #include file="../config/db.asp" -->
<!-- #include file="../config/function.inc.asp" -->
<%
set rst=server.createobject("adodb.recordset")
set fs=server.createobject("scripting.filesystemobject")
%>
<!-- #include file="../config/formdata.inc.asp" -->
<html>
<head>
<title>后台友情链接管理</title></head>
<body>
<%
if request.querystring("act")="add" then
sql="tbl_link"
rst.open sql,conn,1,3
rst.addnew
rst("lnk_image")=formdata.item("image")
rst("lnk_name")=formdata.item("name")
rst("lnk_url")=formdata.item("url")
rst.update
rst.close
set myerrors=conn.errors
if myerrors.count=0 then
ms

if myerrors.count=0 then
msgboxu "添加友情链接<"&formdata.item("name")&">成功!"
else
msgboxu "添加友情链接失败!原因:"&myerrors.item(0).description
fs.deletefile server.mappath("../upfile")&"\"&formdata.item("image")
end if

你把这段修改一下看看是不是函数问题

if myerrors.count=0 then
response.write"添加友情链接<"&formdata.item("name")&">成功!"
else
response.write"添加友情链接失败!原因:"&myerrors.item(0).description
fs.deletefile server.mappath("../upfile")&"\"&formdata.item("image")
end if
response.end

你把formdata.item("name")赋值给一个变量,如fname=formdata.item("name"),
然后在有用到的那两个地方用fname代替。
==========================================================
感觉那个函数有问题,这样调试一下看看:
if myerrors.count=0 then
Response.Write "添加友情链接成功!"
============