|
Creating 'delfromdb.asp' page :
Create a new ASP page and name it 'delfromdb.asp'. Copy and paste the following code
into it :
<!--#include file="editme.asp"-->
<html>
<head>
<style>
body { font-family : Verdana; font-size : 8pt; }
</style>
</head>
<body>
<%
Dim con, strDB
' URL
strURL = Request.QueryString("del")
' Creating our Connection Object
Set con = CreateObject("ADODB.Connection")
con.Open strDB
' Now deleting the account
con.Execute("delete * from all_pages where url = '" & strURL & "'")
' Telling the admin that account has been deleted
Response.Write "<b>Account successfully deleted : " & strURL & " </b>."
' Done. Now release Objects
con.Close
Set con = Nothing
%>
</body></html>
Reviewing the code :
<!--#include file="editme.asp"-->
<html>
<head>
<style>
body { font-family : Verdana; font-size : 8pt; }
</style>
</head>
<body>
<%
Dim con, strDB
Same as earlier pages.
' URL
strURL = Request.QueryString("del")
strURL receives the URL entered in the Form 3 of 'addtodb.htm' page.
' Creating our Connection Object
Set con = CreateObject("ADODB.Connection")
con.Open strDB
Creates the Connection object and opens the database.
' Now deleting the account
con.Execute("delete * from all_pages where url = '" & strURL & "'")
Deletes the record in the database of the given URL.
' Telling the admin that account has been deleted
Response.Write "<b>Account successfully deleted : " & strURL & " </b>."
' Done. Now release Objects
con.Close
Set con = Nothing
%>
</body></html>
Tell the user that the given URL has been deleted. Then release the objects and end the page.
On the next page we create 'search.htm' to create a Form to show users to enter keywords to search pages from
our Search Engine database.
Next ->
|