ASP deletes the specified logger code

Source: Internet
Author: User

<%
Database Tutorial Connections
Sub Opendb ()
Set Rs=server. CreateObject ("Adodb.recordset")
Set Conn=server. CreateObject ("Adodb.connection")
Conn.connectionstring= "Provider=Microsoft.Jet.OLEDB.4.0; Data source= "&server.mappath (" Datasource/hhinfo.mdb ")
Conn.Open
End Sub

Determine if the user is logged in

If session ("username") = "" and Session ("userpwd") = "" Then
Response. Redirect ("login.html")
End If
Dim sql,id

Gets the value that the ID passes over the address bar

Id=html_encode (Request. QueryString ("id"))
If id= "" or not IsNumeric (ID) Then
Response. Write ("Illegal operation")
Else
Sql= "Delete * from new where id=" &id
Call OPENDB ()
Conn.execute (SQL)
If Err=0 Then
Response.Write ("<script>alert (' delete success '); location= ' www.111cn.net/a.asp ';</script>")
Else
Response.Write (' <script>alert (' delete failed, server busy ... '); location= ' new.asp ';</script> ')
End If
End If
%>

How to use
<a href= "http://www.111cn.net/?id=1" > Delete </a>

Original site article, reprinted annotated Source Www.111cn.net

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.