首页 新闻 会员 周边

ASP文章置顶功能

0
悬赏园豆:50 [已解决问题] 解决于 2011-11-14 08:37
<%Function updatestr(Info_Id)set updatestr=Server.CreateObject("Adodb.Recordset")updatestrsql="update kdb_caption set stick=1,mod_time='"&Date()&"' where Info_Id="&Info_Idupdatestr.Open ShowCatnameSql,Conn,1,3updatestr.Execute()updatestr.CloseSet updatestr=Nothing        End Function%><a href="#" onClick="updatestr(<%=ShowRs("Info_Id")%>)">置顶</a>我想要的效果就是点击置顶后触发后台程序,更新数据库,但是我不是很懂ASP,希望有高手指点一下
Mr.ch的主页 Mr.ch | 初学一级 | 园豆:6
提问于:2011-11-10 17:22
< >
分享
最佳答案
0
setTop.asp
<%
Function updatestr(Info_Id)
set updatestr=Server.CreateObject("Adodb.Recordset")
updatestrsql="update kdb_caption set stick=1,mod_time='"&Date()&"' where Info_Id="&Info_Id
updatestr.Open ShowCatnameSql,Conn,1,3
updatestr.Execute()
updatestr.Close
Set updatestr=Nothing
End Function
%>
<%
info_id = request("info_id")
updatestr(info_id)
Response.Write("<script>置顶成功</script>")
%>

 

调用页面

<a href="setTop.asp?info_Id=1">置顶</a>

上面数字1为你info的Id

以后发提问排下版

收获园豆:50
奶茶爽歪歪 | 菜鸟二级 |园豆:243 | 2011-11-11 13:54
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册