为什么点击删除没有用?(100分)

L

lyy8848

Unregistered / Unconfirmed
GUEST, unregistred user!
我想用以下程序:
</script>
<script language="VBScript">
function panduan(cans_a,cans_b)
if MsgBox("您是否要删除此记录?", 289,"警告信息!") = 1 then
window.location="del_from_db.asp?delid="&amp;cans_a&amp;"&amp;delbz="&amp;cans_b
end if
End Function
</script>


<a href="#"
onclick=panduan('<%=my_rs("id")%>','My_only')><img border="0" src="images/icon_delete.gif"
align="absmiddle" alt="删除这封信!" width="15" height="15"></a>

del_from_db.asp的程序如下:

<%
if Session("Ulogin")<>"yes" then
Response.Redirect ("login.asp")
end if
del_id=Request("delid")
del_bz=Request("delbz")
response.write "ssssssssssssssssss"
if del_bz<>"My_only" and del_bz<>"My_public" then
Response.Redirect ("index.asp")
end if
if del_bz="My_public" and Session("Urule")<>"a" and Session("Urule")<>"b" then
Response.Redirect ("index.asp")
end if
DataSource=Request.ServerVariables("li")
strconnstring = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;
Password=sa;
Initial
Catalog=er;"
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.open strConnString
strSql="DELETE jhtdata where name='"&amp;del_id&amp;"'"
my_Conn.Execute (strSql)
my_Conn.Close
set my_Conn = nothing
Response.Redirect ("index.asp")
%>
为什么点击删除没有用?

 
我也是这样的...
大概是权限没有~~~
 
你可以试一下这样做:
//<a href="#"
//onclick=panduan('<%=my_rs("id")%>','My_only')><img border="0" src="images/icon_delete.gif"
//align="absmiddle" alt="删除这封信!" width="15" height="15"></a>
<a [red]href="VBScript:panduan('<%=my_rs("id")%>','My_only')" [/red]>
<img border="0" src="images/icon_delete.gif"
align="absmiddle" alt="删除这封信!" width="15" height="15"></a>
 
多人接受答案了。
 
顶部