Page

15.1.1- A Web-based Classifieds System

Created by Brendan Doss.
Last Updated by Jim Minatel.  

PublicCategorized as 15. Writing an Application.

Not yet tagged
<< 15.1.0- Introducing the Wrox Classifieds ApplicationChapter1515.2.0- Setting up the Database >>

A Web-based Classifieds System

We'll implement a web-based classified ad system. Any user who us trying to buy an item can:

 

  • View items for sale
  • Bid on an item they wish to purchase

 

In addition, any user who is trying to sell an item can:

 

  • Place a new item for sale
  • Browse a list of the items that they're trying to sell, and examine the bids that have been made on each of those items
  • Accept a bid on an item that they're selling

 

This system will also allow users to do straightforward administrative tasks like:

 

  • Browse the listings to see what's for sale
  • Register with the system (users can browse without registering; but they must register if they want to sell an item or bid for an item)
  • Log on to the system
  • Change their registration details

 

If our web site takes off, we'll have a large user-base – some will be buyers and some will be sellers (and hopefully some will do some buying and some selling via our system). In addition, some users will be unregistered 'window-shoppers' – these users will need to register when they spot something they want to bid for.

The Advantages over a Print-based Classifieds System

Our Internet-based classified ad system provides certain advantages to the seller over traditional printed classifieds:

 

  • When a seller submits an item for sale, it's immediately viewable by potential buyers. There's no time delay while we all wait for the newspaper to be printed
  • Responses from potential buyers are held by the system's data store – rather than being passed directly back to the seller. This means that the seller doesn't have to be available to respond 24 hours a day
  • The seller can dynamically adjust the price – based on the amount of response an item receives

 

The Internet classified ad system also provides advantages for potential buyers:

 

  • Shoppers can see the level of interest in an item before determining the price they are willing to pay
  • When a shopper makes a bid, he is told whether the bid is the highest bid made on that item
  • The global nature of the Internet means that the potential audience for each advert is global – it's not limited to the encatchment area of a printed newspaper

Building the Application

We'll build our application in stages. Each stage will build on the previous stages, and will add a new piece of functionality to the application. The sequence we'll follow in this chapter is:

 

  • Database setup
  • Home page construction
  • User registration and login
  • Adding items to the sale listings
  • Browsing the listings and bidding for items
  • Accepting a bid and completing the sale

 

To get us started, let's take a look at the ASP pages that will feature in our application. There are 14 pages altogether. Each of these pages serves a different function and contains the code for carrying or certain tasks. The pages are given names that reflect their functionality:

 

Page

Purpose

Default.asp

The home page. Provides links to the login, registration and browse pages.

BrowseListings.asp

Shows a table containing brief details of each item that is currently available for purchase. From this page, registered users will be also able to select a particular product for sale, and click-through to Bid.asp (and thus to bid on the object).

Login.asp

Enables a registered user to enter a username and password, and hence login to the system.

CheckLogin.asp

Contains ASP logic for checking the username and password (from the form in Login.asp) against details contained in the database. This page has no user interface.

Register.asp

Contains a form that enables new users to enter the necessary registration details. Also used to enable existing users to change their registration details.

AddUser.asp

Contains ASP logic for placing user details (from the form in Register.asp) into the database. This page has no user interface.

MenuForRegisteredUsers.asp

This is the first page that a user sees once he has logged in – it welcomes the registered user to the site, presenting a simple menu of options that the user can choose from. Sometimes it also performs a second function: if the user placed a bid on an item during a previous visit to this site, and if the vendor of that item has subsequently accepted the bid, then this page will alert the user to the fact that his bid was successful.

ViewMySaleItems.asp

Allows a registered user to view the details of all of the items that he has made available for sale. From this page, the user can click-through to Item.asp and edit these details. The 'highest bid' for each of these items is also displayed, and the user can accept a bid on an item via this page.

Item.asp

Allows a registered user to enter details of an item that he wishes to make available for sale. Also used (as a click-through from ViewMySaleItems.asp) to allow the user to edit the details.

 

AddItem.asp

Contains ASP logic for placing the details of a sale item (from the form in Item.asp) into the database. This page has no user interface.

Bid.asp

Allows a potential buyer to view the details of a sale item, and to enter a bid.

AddBid.asp

Contains ASP logic for placing the details of a bid (from the form in Bid.asp) into the database. This page has no user interface.

SaleDetailsForSeller.asp

When a user accepts a bid (on ViewMySaleItems.asp), this page updates the database accordingly, and displays the sale details to the seller.

BuyerAcceptance.asp

When a potential buyer's bid has been accepted, the buyer is alerted via MenuForRegisteredUsers.asp. At this stage, the buyer can click-through to BuyerAcceptance.asp and acknowledge the alert, and thus complete the sale.

 

When we consider any application of this size, we can gain a lot of understanding by representing the relationship between pages in a graphical way. As you work through the application, you may find the following diagram useful – it shows the routes that we'd expect our users to travel as they use the application:

 

Could not generate link to image with ID:

 

The click-throughs and redirections shown in this diagram illustrate the key stages of the sale process. As you'll see when we come to write the code, there are other click-throughs which are not shown in this diagram. These additional links give users the option of moving directly to pages like Login.asp, Register.asp and BrowseListings.asp – thus allowing the user a controlled amount of extra freedom to move between the pages of the application.

<< 15.1.0- Introducing the Wrox Classifieds ApplicationChapter1515.2.0- Setting up the Database >>

Copyright © 2003 by Wiley Publishing, Inc.

Powered by Near-TimeTerms of Services | Privacy Policy | Security Policy |