Create an Active Server Page to delete messages from a forum. This ASP should take a f orum’s filename and t he timestamp o f the message as form arguments. Modify formatting. xsl to provide a link to the ASP for each message. [Hint: To remove an element’s child, use removeChild, with the node to remove as a parameter.]
What will be an ideal response?
```
1 <% @LANGUAGE = "VBScript" %>
2 <% Option Explicit %>
3
4<% ' deletePost.asp %>
5
6<%
7 Dim xmlFile, xmlRoot, xmlNodes, xmlItem
8 Dim strPath, strTime
9
10 If Request( "id" ) <> Empty And _
11 Request( "file" ) <> Empty Then
12
13 Call Application.Lock()
14
15 strPath = Server.MapPath( Request( "file" ) )
16
17 Set xmlFile = Server.CreateObject( "Microsoft.XMLDOM" )
18 xmlFile.Async = False
19
20 If Not xmlFile.Load( strPath ) Then
21 Call Application.Unlock()
22 Call Response.Redirect( "invalid.html" )
23 End If
24
25 Set xmlRoot = xmlFile.DocumentElement
26 Set xmlNodes = xmlRoot.ChildNodes
27
28 For Each xmlItem In xmlNodes
29 strTime = xmlItem.getAttribute( "timestamp" )
30
31 If strTime = Request( "id" ) Then
32 Call xmlRoot.RemoveChild( xmlItem )
33 End If
34 Next
35
36 Call xmlFile.Save( strPath )
37 Call Application.Unlock()
38 End If
39
40 Response.ContentType = "text/xml"
41 Call Res
You might also like to view...
Case-Based Critical Thinking QuestionsCase 8-1James created a table of his school soccer team schedule that will be placed on the team's Web page. The table contains four columns: Opponent, Home/Away, Date, and Start Time. The table will contain 10 rows. James has some problems with formatting the table and asks Kyra to help him resolve them.There are three consecutive home games (rows 2-4) where the game starting time is the same. Kyra tells James that there is a way to combine cells with the same value. Which of the following is the correct one?
A. For the column "Start Time" of the second row, include colspan="3" within the
Describe the difference between a server operating system and a desktop operating system.
What will be an ideal response?
With the Minus Back pathfinder, the backmost object "punches a hole" in the object(s) in front.
Answer the following statement true (T) or false (F)
The BETWEEN operator is an essential feature of SQL.
Answer the following statement true (T) or false (F)