帮忙看下
<%
sub artidele
%>
<table width="100%" border=0 align=center cellpadding=2 cellspacing=1 bordercolor="#C7D4F7" class=tableBorder>
<tbody>
<tr>
<th align=center >系统提示</th>
</tr>
<tr bgcolor="#BBC8D0">
<td align="left" class=txlrow>
<%
if hid="" then
response.write "删除失败"
else
'***********************************************
'函数名:getPicUrl
'作 用:获得信息里的图片地址
'参 数:str ----信息
'***********************************************
function getPicUrl(str) ////////////////这里提示语法错误。怎么改
dim content,regstr,url
content=str&""
regstr="src=.+?.(gif|jpg)"
url=Replace(Replace(Replace(RegExp_Execute(regstr,content),"'",""),"""",""),"src=","")
getPicUrl=url
end function
Function RegExp_Execute(patrn, strng)
Dim regEx, Match, Matches,values '建立变量。
Set regEx = New RegExp '建立正则表达式。
regEx.Pattern = patrn '设置模式。
regEx.IgnoreCase = true '设置是否区分字符大小写。
regEx.Global = True '设置全局可用性。
Set Matches = regEx.Execute(strng) '执行搜索。
For Each Match in Matches '遍历匹配集合。
values=values&Match.Value&","
Next
RegExp_Execute = values
End Function
'***********************************************
'函数名:DeleteFile
'作 用:删除文件
'参 数:file ----文件路径
'***********************************************
Function DeleteFile(file)
dim fso
Set fso = CreateObject("scripting.filesystemobject")
'if fso.fileExists(file) then
fso.DeleteFile server.MapPath(file)
'end if
Set fso = nothing
End Function
dim id
id=hid
sql = "select * from s_article where id = "&id&""
rs.open sql,conn,1,3
if rs.bof and rs.eof then
response.write "<script language=javascript>alert('error!')</script>"
response.End()
else
dim picUrl
dim picUrlArray
dim x,y
picUrl = getPicUrl(rs("s_content"))
if picUrl <> "" then
picUrl = left(picUrl,len(picUrl)-1)
picUrlArray = split(picUrl,",")
for x = 0 to ubound(picUrlArray)
if instr(picUrlArray(x),"/uploadfile/") > 0 then
DeleteFile(picUrlArray(x))
end if
next
end if
rs.delete
rs.close
set rs=nothing
conn.close
set conn=nothing
'response.write " <span >√</span> 删除成功"
'response.write " 单击<a href='artinew.asp' target='main'>返回</a>"
response.Write("<script text='javascript'>alert('删除成功!'); window.location.href='artinew.asp'; </script>")
end if
%>
</td>
</tr>
</tbody></table>
<%
end sub
%>