Aim:
To create an online application
using database access.
Algorithm:
- Create
an ASP page which get details from the user.
- Create
a database connection using ASP code.
- Compare
the details of the user with the database.
- Get
the amount from the user from payment gateway.
- Deliver
the products the user to his/her address.
Program:
send.asp
<!--Copyright
2001 © by nima -->
<html>
<head>
<meta
http-equiv="Content-Language" content="en-us">
<meta
name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta
name="ProgId" content="FrontPage.Editor.Document">
<meta
http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<title>New
Page 1</title>
<style>
<!--
.lnk { text-decoration: none; color:
#FFFFFF; font-weight: bold }
-->
</style>
</head>
<body>
<%
dim view
view = request.querystring("view")
if view
= "" then
view = "view1.xsl"
end if
%>
<table
border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111"
width="100%" id="AutoNumber1" height="100">
<tr>
<td width="33%"
colspan="2" height="81">
<h1>XML Database</h1>
</td>
<td width="67%"
colspan="2" height="81"> </td>
</tr>
<tr>
<td width="16%" align="center"
dir="ltr" bgcolor="#336699" height="19">
<a class="lnk"
href="send.asp?view=view1.xsl">View1</a>
</td>
<td width="17%"
bgcolor="#336699" align="center" dir="ltr"
height="19">
<a class="lnk"
href="send.asp?view=view2.xsl">View2</a></td>
<td width="17%"
bgcolor="#336699" align="center"
height="19"> </td>
<td width="50%"
bgcolor="#336699" align="center"
height="19"> </td>
</tr>
</table>
<p> </p>
<%
dim xmlhttp,xmlDom,xsldom,Query
set xmlhttp=createobject("MSXML2.XMLHTTP")
set
xmlDom=createobject("MSXML2.domdocument")
set
xslDom=createobject("MSXML2.domdocument")
xmldom.async=false
xsldom.async=false
query = "<main><sql>select
* from product</sql></main>"
xmlhttp.Open
"POST","http://localhost/xmlDatabase/datasource.asp", false
xmlhttp.send query
if xmlhttp.status <> 200 then
response.write "Error !!!"
end if
xmldom.load xmlhttp.responseXML
xsldom.load
server.mappath(".")+"/"+view
response.write XMLDom.transformNode(XSLDom)
%>
<%
set xmlhttp =
nothing
set xmldom=
nothing
set xsldom =
nothing
%>
</body>
</html>