Create an HTML document which uses the XMLHttpRequest object to submit the customer profile created in Exercise 28.4. Also, create an ASP page which accepts the submitted data and inputs it into the database.
What will be an ideal response?
```
1 <% @LANGUAGE = "VBScript" %>
2 <% Option Explicit %>
3 <% Response.Expires = 0 %>
4 <%
5 ' Example 28.6 : customerSubmit.asp
6
7 Dim xmlData, xmlRoot, xmlBill, xmlShip, xmlCredit
8 Dim objConn, objRS
9
10 Set xmlData = Server.CreateObject( "Microsoft.XMLDOM" )
11 xmlData.Async = False
12 Call xmlData.Load( Request )
13
14 Set xmlRoot = xmlData.DocumentElement
15 Set xmlBill = xmlRoot.SelectSingleNode( "bill" )
16 Set xmlShip = xmlRoot.SelectSingleNode( "ship" )
17 Set xmlCredit = xmlRoot.SelectSingleNode( "credit" )
18
19 Set objConn = Server.CreateObject( "ADODB.Connection" )
20 Set objRS = Server.CreateObject( "ADODB.RecordSet" )
21 Call objConn.Open( "DSN=dbStorefront" )
22
23 objRS.ActiveConnection = objConn
24 objRS.Source = "Customer"
25 objRS.CursorType = 1 ' adOpenKeyset
26 objRS.LockType = 2 ' adLockPessimistic
27 Call objRS.Open()
28
29 Call objRS.AddNew()
30 objRS( "userid" ) = _
31 xmlRoot.SelectSingleNode( "userid" ).text
32 objRS( "passwor
You might also like to view...
The
element will produce the smallest-sized heading on a Web page.
Answer the following statement true (T) or false (F)
Setting and maintaining the correct paths for all links is essential if you want to avoid having broken links in your site.
Answer the following statement true (T) or false (F)