ASP入门基础教程-实例 网上图书管理系统

豆豆网   技术应用频道   2006年10月27日  【字号: 收藏本文

本文详细介绍ASP入门基础教程-实例 网上图书管理系统

  本管理程序的主要功能有:1、图书列表展示功能;2、图书放置购物车、移去购物车和清空购物车功能;3、购书结帐功能;4、新会员注册功能。

  Iindex.asp 首页。框架结构。上框架连接Top.htm页面,下框架连接Booklist页面。

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网上图书管理系统--图书列表</title>
</head>
<frameset rows="80,*" cols="*" frameborder="NO" border="0" framespacing="0">
<frame src="top.htm" name="topFrame" scrolling="NO" noresize >
<frame src="booklist.asp" name="mainFrame">
</frameset>
<noframes>
<body>
</body>
</noframes>
</html>

  Conn.asp 数据库连接文件。在所有与数据库连接的页面中只要包括该文件,即可以连接和打开数据库。

'创建连接对象
<% set Conn=server.CreateObject("ADODB.Connection")
'连接字符串
strSQL="Driver={Microsoft Access Driver (*.mdb)};DBQ=" &_
server.MapPath("bookshop.mdb")
conn.open(strSQL)
%>

  Top.htm 图书列表 Top 页。仅仅是一个图片标题页。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网上图书管理系统</title>
<link href="style.css" rel="stylesheet">
</head>
<body topmargin="0">
<table width="770" height="124" border="0" cellpadding="-2" cellspacing="-2">
<tr>
<td background="images/bg_booklist.gif">&nbsp;</td>
</tr>
</table>
</body>
</html>

  Booklist 以表格的形式分页显示出所有的图书。

作者:含笑    责编:豆豆技术应用

正在加载评论...