Design and implementation of an online trading market scheme (i)

Source: Internet
Author: User
Tags getdate include insert interface query
Design | Online This paper designs an online commodity trading system. As a part of the virtual community, the system simulates the market behavior of people in real life and provides the purchase and sale service for the community users. Using this system, users can not only publish and query supply and demand information, but also real-time online communication, express the purchase and sale of the intention to engage in purchase and sale activities, so as to achieve online transactions.

System with Windows NT 4.0 as the platform, IIS 4.0 as a Web server, MS SQL Server 7.0 database server, the database has a user table, supply and demand information table and sales Record table, three data tables record related transaction data, development tools using HTML, ASP and JavaScript, part of the program is as follows.

User identity authentication Subsystem
The system uses the member system, all users must register first, can enter the market. The user is managed hierarchically, depending on the user level to determine the length of the user's registered supply and demand information release time. The user name and password are used to control the registration behavior and transaction behavior of the users. This subsystem mainly by the program login.htm, CHECK. ASP completed.
Provide user login interface

LOGIN. Htm
......
< FORM action= "check.asp" method=
"Post" Name= "Form1" target= "_top" >
User:< INPUT name= "username" size= ">< br >
Password:< INPUT name= "USERPD" type=
"Password" size= ">< br >
< INPUT type= "submit" value= "enter" >  
< INPUT type= "reset" value= "rewrite" >
......

Validate user login information and automatically register new users

CHECK. Asp
......
' Handle actions that have been registered with the user
If not rs.eof then
' The password is not correct
If Userpd#trim (RS (1). Value) Then
Response.Write "< title > Login Error Tip </title >< br >"
Response.Write "< center > username" and
"Password" does not match! </center >< br > "
Response.Write "Causes and Treatment methods:< br >
1. If you are the first time to log in, then the user name has been registered by someone else!
You can only change other names to register;< br > "
Response.Write "2. If you have previously registered successfully with this name,
Then it's a bad password.;< br > "
Response.Write "3. If the password is not a problem,
It may be that your username has been embezzled by someone else,
And the person who embezzled changed the password.
Response.Write
"Please contact < a href=mailto:nicstaff@lyac.edu.cn >
Admin < a > contact. "
Response.Write "< a href= ' Javascript:history.go
(-1); ' > Click here to modify </a ></body > "
Response.End
Else ' login right, enter the market
Response.Redirect "Market.htm"
End If
' Handle unregistered new users
Else
sql1= "Insert Park_users values
(' &username& ', ' "&userpd&",
GETDATE (), GETDATE (), 1) "
sql2= "Insert Park_online values
(' &username& ', ' "&ip& ', GETDATE ())"
Conn.execute (SQL1)
Conn.execute (SQL2)
Response.Write "< center >
!!! You are welcome to visit!!! </center >< br > "
Response.Write "< Center > your username is:"
&request.form ("username") & "" &
"The password is:" &request.form ("USERPD") & "< br >"
Response.Write "Come again you can continue to use the above data!"
< br ></center > "
End If
......

Supply and Demand Information inquiry subsystem
The user can get detailed supply and demand information through the notebook system, including commodity name, price, quantity, contact method and related description, even pictures, audio and video. Users can use classified browsing and keyword query two ways, for the keyword query, as long as the input product name or express the use of goods, shape and other words or phrases, the system can be a special query algorithm, the database for quasi-full-text fuzzy query. This subsystem mainly by the program search1.asp, SEARCH2. ASP and link.asp complete.
Accept and complete a user query request

SEARCH1. Asp
......
' Data from the query interface
C_type=request.querystring ("C_type")
Goods_class=request.form ("D1")
S=request.form ("T1")
Set conn= Server.CreateObject ("Adodb.connection")
' Open the Database
conn.connectionstring= "Driver={sql Server};
server=;uid=;p wd=;d atabase= "
Conn.Open
Set session ("RS") =server.createobject
("Adodb.recordset")
' Construct a retrieval algorithm
If goods_class= "All" then
Sql= "Select Goods_name,goods_class,
Description,publisher,contact,pub_date from Market_goods
where client_type= ' "&c_type&" ' and
Goods_name like '% ' &s& '% '
Else
Sql= "Select Goods_name,goods_class,
Description,publisher,contact,pub_date from Market_goods
where client_type= ' "&c_type&" ' and goods_class=
' &goods_class& ' and goods_name like '% ' &s& '% '
End If
......
If c_type= "s" Then
Response.Write "< center > Seller's Market </center >"
Else
Response.Write "< center > Buyer's Market </center >"
End If
......
<!--#include file= "link.asp"-->

Complete the display of other screens when the search results exceed one screen

SEARCH2. Asp
......
For J=1 to session ("RS"). pagesize
Response.Write "< tr >"
Response.Write "< td >" &session
("RS"). absoluteposition& "</td >"
For i=0 to session ("RS"). Fields.count-1
Response.Write "< td >" &session
("RS") (i). value& "</td >"
Next
Response.Write "</tr >"
Session ("RS"). MoveNext
If session ("RS"). EOF Then
Exit For
End If
Next
......
<!--#include



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.