ADO的基本操作(四)修改

本文介绍了一个使用VBScript实现的ASP页面,该页面允许用户修改博客栏目的名称,并通过提交表单来更新数据库中对应的栏目信息。页面包含了简单的表单元素及后端处理逻辑。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <!--#include file="inc/conn.asp"-->
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  7. <title>修改栏目</title>
  8. </head>
  9. <body>
  10. <form id="form1" name="form1" method="post" action="tempAddItem.asp">
  11. <table width="53%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:50px;">
  12.     <tr>
  13.       <td> 要把栏目修改为:
  14.         <label>
  15. <input type="text" name="txtItem" id="txtItem" />
  16. </label>
  17. <label>
  18. <input type="submit" name="go" id="go" value="确定修改" />
  19. </label></td>
  20.     </tr>
  21. </table>
  22. </form>
  23. <%
  24. id=trim(request("id"))
  25. if id="" then
  26.    'response.Write("<a href='javascript:history.go(-1)'>返回</a>")
  27.    response.Write("<script>")
  28.    response.Write("alert('你是非法用户');")
  29.    response.Write("</script>")
  30.    response.Redirect("temp.asp")
  31.    response.End()
  32. end if
  33. enter=request("go")
  34. itemName=trim(request("txtItem"))
  35. if enter<>"" and itemName<>"" then
  36.    sql="update blogItem set itemName='"&itemName&"' where itemId="&cint(id)
  37.    conn.execute(sql)
  38.    response.Redirect("temp.asp")
  39. end if
  40. %>
  41. </body>
  42. </html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值