Pages

Friday, September 24, 2010

Introduction of Online Community Portal

The Online Community Portal which has been running as a discussion forum based on phpBB (1) open source(15) discussion forum software. And their back end database is served by MySQL (2) Database management system (DBMS).

The site provides a basic discussion thread based forum interface with various categories and forums in different sections of IT and its subsections. The discussions of the site a visible for any users who visit the site and only registered members are allowed to discuss and reply threads in the forum. Some of the forums in the site are moderated forum and restricted to a particular group of members in the site. Moderators are assigned for each forum and moderators and administrators can do the site maintenance as well as the user maintenance.

Once a guest is registered with the site they become General Members of the site, and they can post new Article/question threads or reply to existing threads in the forum, they can participate in the option polls in the forums, and if the forum permissions allow they can create polls. And they can subscribe to any discussion so that they get alerts, when someone replies to that thread. And users can post threads and lock them so that others can only view them but cannot reply. Apart from discussions members are allowed to send and receive
private messages with other members in the site. The more posts the user make their ranking the site goes higher.

Administrators who have the full control of the website, has all the features of a moderator. Moderators in the site will be moderating and maintain posts in their relevant forums. If there are any forums that allow only posts after approval from moderator, then they have to read and decide whether to approve that post or reject them. And also moderators can Ban any abusive users from the website or warn them. And also they can lift off the bans or the warnings from the members after some period of good behavior in the site and the general user and they can create delete forums and sections. They can give ranks to users and promote them as moderators or administrators. Administrators can send mass emails and newsletters to all the members of the website. They can physically access the script files of the forum software and modify them to tweak and update the forum software.

Even though the forum software is free open source software and has a lot of advanced and good features to run a website, the forum only interface is not familiar to all the users who use internet, and it is very hard for beginners to find what they want exactly. And the less attractive interface of the website drives away the new users who visit the website.

And the sites forum software requires a high maintenance, because of very frequent patch releases and mainly because of SPAM. And customization of the software requires extensive knowledge on PHP scripting, and even a small mistake while the upgrade process might result in loss of entire site, and most of all once the software is customized the official providers of the software will not provide support in any cases which again leads to high risk.

These problems with the issues listed below, made the administration team of the website to go on with developing their own web portal with complete content management system to administrate the website.

Critical Issues in the Current Forum

1. Integrating the forum with a graphical front end is very difficult and needs special skills and understanding of the PHP scripting as well as phpBB software.

2. Frequent failure of the forum software, which causes loss of members and valuable information.

3. Difficult to use for the beginners, which drives traffic out of the websites.

4. Since the software is a very common open source product, there are too many threats are available for the site and the risk of hacking is very high.

5. Customizing the site and upgrading the site software to a newer version is never possible to do both at same time because the customized phpBB products are not officially supported.

6. The poor Graphical interface of discussion forums. Drive members away from the website.

7. The ease of use is very low. Because the Articles, teaching lessons, and discussions are all mixed up with each other in the forums. Where it is hard to find the relevant one we need soon.

8. The control over the users and the contents of the site are limited. The site has to stick to a particular user interface constantly with very rare changes.

9. Requirement for special sections in the website such as events calendar, one complete control panel for entire site content.

Website Reuirements

A website should be developed with online secured user management system, Article management system, discussion forum, and Content management system and with various other web technologies such as RSS (Really Simple Syndication) Feeds and Search engines, which Enables publishing articles and discussing various topics on IT, where it provides users a one stop learning website for all their IT needs, and for administrators and owners to manage the entire website with centralized administration, serve for users who are willing to learn online and earn revenue through the advertisements displayed in the site.

1. FUNCTIONAL REQUIREMENT
Functional requirements define the specific functions that the system performs, along with the data operated on by the functions. The functional requirements are presented in scenarios that depict an operational system from the perspective of its end users. Included are one or more examples of all system features and an enumeration of all the specific requirements associated with these features.

The system should provide the following functions for the general user.
1. General information:
• Provide recent discussions and articles on the home page so that members can see the recent updates in the site.
• Customize the homepage with user relevant contents.
• Show General User related information.
• Contact site administration for queries and reports.
2. User Registration and set up user profile.
• Users can register with the site with a user name and password
• And complete/update their profile details.
• And subscribe for newsletters.
• Reset and Retrieve password.
3. Discuss in forums
• Registered users can create new posts in forums.
• Registered users can reply to posts in forum
• Subscribe for a thread so that members get mail alerts on each reply for the
thread.
• Create threads with no reply option
4. Write Articles
• Users can write articles on the available categories of the site.
• Rate articles.
• Read and subscribe for a particular category of articles.
• Add comments on articles.
5. Option polls
• Vote in option polls
• View results of the polls.
6. News letters
• Subscribe for HTML newsletters.
• Subscribe for Plain Newsletters.
• Unsubscribe from Newsletters.

For Administration editors and moderation the system is expected to fulfill following requirements.
1. User Administration (Administrator)
• Enable/ Disable/ Delete users in the site.
• Reset user’s password.
• Promote/ Demote user roles.
• Create new user roles.
• Find user by name/ email.
2. Forum Management
• Create/ Edit new forums.
• Create moderated forums.
• Approve/ Disapprove posts.
3. Article Management.
• Approve/Disapprove Articles
• Create/Edit Sections.
• Edit Articles.
• Remove published Articles.
• Manage and approve comments on articles.
4. Poll Management
• Create and update polls.
• Set the current polls
• Archive polls.
5. Newsletter Management
• Prepare and send newsletters.
• Manage archived newsletters.
6. Advertisements Management
• Add new Advertisements in Ad zones.
• Create Ad zones.
• Update Ad zones and ad codes.
7. System Exception logs.

2 SUPPLEMENTARY REQUIREMENTS

Supplementary requirements address aspects of the system other than the specific functions it performs. These aspects include system performance, costs, and such general system characteristics as reliability, security, and portability. The non-functional requirements also address aspects of the system development process and operational personnel.
• USABILITY- Target audience of the system is the general public accessing the Internet. So, the system should be able to be accessed by people with sufficient amount of knowledge to use a basic web-site and a standard windows-based application. User-interface of the web-component should adhere to standard web designing principles.
• ACCURACY AND RELIABILITY- The system should be accurate to the maximum extent (99.9%). Major bugs affecting accuracy will not be tolerated. It should not cease operation due to any invalid activity by the user or any other internal function, otherwise explicitly closed by the user.
• PERFORMANCE –This should not exhaustively use system resources while its normal operation, otherwise a major processing is done within the system as requested by the user. Website should be able to serve thousands of users concurrently without overloading the system, or the database server, or without showing radical decrease in performance.
• SECURITY- All personal information should be saved on the web server and the credential related details must be encrypted using some hashing algorithm. Frequent back up of database should be done. Administrative task on the server-side should only be allowed to whom having a high-level access.

Wednesday, September 15, 2010

Class Diagrams of Online Forum

The purpose of a class diagram is to depict the classes within a model. In an object oriented application, classes have attributes (member variables), operations (member functions) and relationships with other classes. The UML class diagram can depict all these things quite easily.

Below are the main classes, used in each sub systems of the system:

Class Involved in Password Recovery
2. Search:
Since search uses the full text indexing to index the articles and the forum post it doesn’t have to use other classes to search only the search is enough.



Class Diagram for Search

Example of Sequence Diagrams

Sequence diagrams contain the same information as Collaboration diagrams, but emphasize the sequence of the messages instead of the relationships between the objects. The arrows between the lifelines represent messages being sent between the objects. Sequence Diagrams clearly depict the sequence of events, show when objects are created and destroyed, are excellent at depicting concurrent operations, and are invaluable for hunting down race conditions.

Example of a Sequence Diagram of a Online Forum:

1. Registration:



2. Write Article:



Master Template of the Online Forum

The main layout of the site uses a master template which will be used in the entire site. And all other contents are contained in the content area of the template. So the detailed designs of the contents are given below with the master template.




The master template contains login tool, Navigation (Categories, menu), Content Area and Option Poll.

Now, see the code of making this forum page. (C sharp Code)
Forum.cs

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using g2c;
namespace g2c.BLL.Forums
{
public class Forum : BaseForum
{
private string _title = "";
public string Title
{
get { return _title; }
set { _title = value; }
}
private bool _moderated = false;
public bool Moderated
{
get { return _moderated; }
set { _moderated = value; }
}
private int _importance = 0;

public int Importance
{
get { return _importance; }
private set { _importance = value; }
}
private string _description = "";
public string Description
{
get { return _description; }
set { _description = value; }
}
private string _imageUrl = "";
public string ImageUrl
{
get { return _imageUrl; }
set { _imageUrl = value; }
}
private List<Post> _allThreads = null;
public List<Post> AllThreads
{
get
{
if (_allThreads == null)
_allThreads = Post.GetThreads(this.ID, "", 0, BizObject.MAXROWS);
return _allThreads;
}
}

public Forum(int id, DateTime addedDate, string addedBy, string title, bool moderated, int
importance, string description, string imageUrl)
{
this.ID = id;
this.AddedDate = addedDate;
this.AddedBy = addedBy;
this.Title = title;
this.Moderated = moderated;
this.Importance = importance;
this.Description = description;
this.ImageUrl = imageUrl;
}
public bool Delete()
{
bool success = Forum.DeleteForum(this.ID);
if (success)
this.ID = 0;
return success;
}
public bool Update()
{
return Forum.UpdateForum(this.ID, this.Title, this.Moderated,
this.Importance, this.Description, this.ImageUrl);
}
public static List<Forum> GetForums()
{

List<Forum> forums = null;
string key = "Forums_Forums";
if (BaseForum.Settings.EnableCaching && BizObject.Cache[key] != null)
{
forums = (List<Forum>)BizObject.Cache[key];
}
else
{
List<ForumDetails> recordset = SiteProvider.Forums.GetForums();
forums = GetForumListFromForumDetailsList(recordset);
BaseForum.CacheData(key, forums);
}
return forums;
}
public static Forum GetForumByID(int forumID)
{
Forum forum = null;
string key = "Forums_Forum_" + forumID.ToString();
if (BaseForum.Settings.EnableCaching && BizObject.Cache[key] != null)
{
forum = (Forum)BizObject.Cache[key];
}
else
{
forum = GetForumFromForumDetails(SiteProvider.Forums.GetForumByID(forumID));
BaseForum.CacheData(key, forum);
}
return forum;
}

public static bool UpdateForum(int id, string title, bool moderated, int importance, string
description, string imageUrl)
{
ForumDetails record = new ForumDetails(id, DateTime.Now, "", title, moderated, importance,
description, imageUrl);
bool ret = SiteProvider.Forums.UpdateForum(record);
BizObject.PurgeCacheItems("forums_forum");
return ret;
}
public static bool DeleteForum(int id)
{
bool ret = SiteProvider.Forums.DeleteForum(id);
new RecordDeletedEvent("forum", id, null).Raise();
BizObject.PurgeCacheItems("forums_forum");
return ret;
}
public static int InsertForum(string title, bool moderated, int importance, string description, string
imageUrl)
{
ForumDetails record = new ForumDetails(0, DateTime.Now,
BizObject.CurrentUserName, title, moderated, importance, description, imageUrl);
int ret = SiteProvider.Forums.InsertForum(record);
BizObject.PurgeCacheItems("forums_forum");
return ret;
}
private static Forum GetForumFromForumDetails(ForumDetails record)
{

if (record == null)
return null;
else
{
return new Forum(record.ID, record.AddedDate, record.AddedBy,
record.Title, record.Moderated, record.Importance, record.Description, record.ImageUrl);
}
}
private static List<Forum> GetForumListFromForumDetailsList(List<ForumDetails> recordset)
{
List<Forum> forums = new List<Forum>();
foreach (ForumDetails record in recordset)
forums.Add(GetForumFromForumDetails(record));
return forums;
}
}
}

Articles Management of Online Forum

Main activities is to set up an online respiratory for all those who are willing to learn the various sections in IT, and the site was used to publish latest Articles related to newest technologies as well as to discuss about IT related issues with people around the world, which in return will provide the best solutions in result of discussions between experts in all areas.



Once a guest is registered with the site they become General Members of the site, and they can post new Article/question threads or reply to existing threads in the forum, they can participate in the option polls in the forums, and if the forum permissions allow they can create polls. And they can subscribe to any discussion so that they get alerts, when someone replies to that thread. And users can post threads and lock them so that others can only view them but cannot reply. Apart from discussions members are allowed to send and receive private messages with other members in the site. The more posts the user make their ranking the site goes higher.


Admin Panel of Online Forum

Moderators are assigned for each forum and moderators and administrators can do the site maintenance as well as the user maintenance. Once a guest is registered with the site they become General Members of the site, and they can post new Article/question threads or reply to existing threads in the forum, they can participate in the option polls in the forums, and if the forum permissions allow they can create polls. And they can subscribe to any discussion so that they get alerts, when someone replies to that thread. And users can post threads and lock them so that others can only view them but cannot reply. Apart from discussions members are allowed to send and receive private messages with other members in the site. The more posts the user make their ranking the site goes higher.

Moderators
in the site will be moderating and maintain posts in their relevant forums. If there are any forums that allow only posts after approval from moderator, then they have to read and decide whether to approve that post or reject them. And also moderators can Ban any abusive users from the website or warn them. And also they can lift off the bans or the warnings from the members after some period of good behavior in the site

Administrators who have the full control of the website, has all the features of a moderator and the general user and they can create delete forums and sections. They can give ranks to users and promote them as moderators or administrators. Administrators can send mass emails and newsletters to all the members of the website. They can physically access the script files of the forum software and modify them to tweak and update the forum software.

Even though the forum software is free open source software and has a lot of advanced and good features to run a website, the forum only interface is not familiar to all the users who use internet, and it is very hard for beginners to find what they want exactly. And the less  attractive interface of the website drives away the new users who visit the website.

And the sites forum software requires a high maintenance, because of very frequent patch releases and mainly because of SPAM. And customization of the software requires extensive knowledge on PHP scripting, and even a small mistake while the upgrade process might result in loss of entire site, and most of all once the software is customized the official providers of the software will not provide support in any cases which again leads to high risk.

Contact.Aspx Code of Online Forum

Coding is done using asp.net 2.0 with c# programming language. 

<%@ Page Language="C#" MasterPageFile="~/Template.master" AutoEventWireup="true"
CodeFile="Contact.aspx.cs" Inherits="g2c.Contact" Title="Get2code.com ‐ Contact Us" %>
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" Runat="Server">
<div class="sectiontitle">Contact Us</div>
<p>For any queries,reports, advertisments, or any partner programs please use the
contact form below to contact us.</p>
<p></p>
we will respond as soon as possible.<br />
<table cellpadding="2">
<tr> <td style="width: 80px;" class="fieldname"><asp:Label runat="server" ID="lblName"
AssociatedControlID="txtName" Text="Your name:" /></td>
<td style="width: 400px;"><asp:TextBox runat="server" ID="txtName" Width="100%" /></td>
<td>
<asp:RequiredFieldValidator runat="server" Display="dynamic" ID="valRequireName"
SetFocusOnError="true"
ControlToValidate="txtName" ErrorMessage="Your name is
required">*</asp:RequiredFieldValidator>
</td>
</tr>
<tr> <td class="fieldname"><asp:Label runat="server" ID="lblEmail"
AssociatedControlID="txtEmail" Text="Your e‐mail:" /></td> <td><asp:TextBox runat="server"
ID="txtEmail" Width="100%" /></td>
<td>
<asp:RequiredFieldValidator runat="server" Display="dynamic" ID="valRequireEmail"
SetFocusOnError="true"

ControlToValidate="txtEmail" ErrorMessage="Your e‐mail address is
required">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator runat="server" Display="dynamic" ID="valEmailPattern"
SetFocusOnError="true"
ControlToValidate="txtEmail" ValidationExpression="\w+([‐+.']\w+)*@\w+([‐
.]\w+)*\.\w+([‐.]\w+)*" ErrorMessage="The e‐mail address you specified is not well‐
formed">*</asp:RegularExpressionValidator>
</td> </tr> <tr>
<td class="fieldname"><asp:Label runat="server" ID="lblSubject"
AssociatedControlID="txtSubject" Text="Subject:" /></td>
<td><asp:TextBox runat="server" ID="txtSubject" Width="100%" /></td>
<td>
<asp:RequiredFieldValidator runat="server" Display="dynamic" ID="valRequireSubject"
SetFocusOnError="true"
ControlToValidate="txtSubject" ErrorMessage="The subject is
required">*</asp:RequiredFieldValidator> </td> </tr>
<tr>
<td class="fieldname"><asp:Label runat="server" ID="lblBody" AssociatedControlID="txtBody"
Text="Body:" /></td>
<td><asp:TextBox runat="server" ID="txtBody" Width="100%" TextMode="MultiLine"
Rows="8" /></td>
<td>
<asp:RequiredFieldValidator runat="server" Display="dynamic" ID="valRequireBody"
SetFocusOnError="true"
ControlToValidate="txtBody" ErrorMessage="The body is
required">*</asp:RequiredFieldValidator>
</td>
</tr> <tr>
<td colspan="3" style="text‐align: right;"> <asp:Label runat="server"
ID="lblFeedbackOK" Text="Your message has been successfully sent." SkinID="FeedbackOK"
Visible="false" />
<asp:Label runat="server" ID="lblFeedbackKO" Text="Sorry, there was a problem sending
your message." SkinID="FeedbackKO" Visible="false" />
<asp:Button runat="server" ID="txtSubmit" Text="Send" OnClick="txtSubmit_Click" />
<asp:ValidationSummary runat="server" ID="valSummary" ShowSummary="false"
ShowMessageBox="true" />

</td>
</tr>
</table>
</asp:Content>

Contact. cs (C#) for Online Forum

The Members can contact the Administrator for queries or questions:





Contact.cs Code:


using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;
using g2c;
namespace g2c.UI
public partial class Contact : BasePage
protected void Page_Load(object sender, EventArgs e)
}
protected void txtSubmit_Click(object sender, EventArgs e)
{
try
{
// send the mail
MailMessage msg = new MailMessage();
msg.IsBodyHtml = false;
msg.From = new MailAddress(txtEmail.Text, txtName.Text);
msg.To.Add(new MailAddress(Globals.Settings.ContactForm.MailTo));
if (!string.IsNullOrEmpty(Globals.Settings.ContactForm.MailCC))
msg.CC.Add(new MailAddress(Globals.Settings.ContactForm.MailCC));
msg.Subject = string.Format(Globals.Settings.ContactForm.MailSubject, txtSubject.Text);
msg.Body = txtBody.Text;
new SmtpClient().Send(msg);
// show a confirmation message, and reset the fields
lblFeedbackOK.Visible = true;
lblFeedbackKO.Visible = false;
txtName.Text = "";
txtEmail.Text = "";
txtSubject.Text = "";
txtBody.Text = "";
}
catch (Exception)
{
lblFeedbackOK.Visible = false;
lblFeedbackKO.Visible = true;
}
}
}
}

Monday, September 13, 2010

Introduction of Online Mobile Store

The shopping cart is a piece of software that acts as an online store's catalog and ordering process. It is used in e-commerce to assist people making purchases online.

And there are some other reasons, which lead to the decision for a web site:
- E-commerce has become the best trend in the market.
- Online business would reach customers easily.
- The track of all deals done will be recorded, and a large amount of customer details can be grabbed.
- And owners can concentrate solely on online business so the need of other resources such as physical locations can be reduced.
- Home delivery of products would bring in more customers.

This project will be a fully automated online mobile shop with a discussion forum to allow members and experts on mobile phones to discuss about the various features of mobiles and related issues and to read reviews on mobile phones by experts.

The other features of the project (website) are given below in detail:
- It will display all the mobile phone details to the customers without any staff interactions.
- Guests can become members on the site and get the advantages of the site.
- Members will be able to purchase phones via the shopping cart, paying online.
- The products ordered online would be delivered to the customer-requested place.
- Members will be able to rate phones.
- Pictorial information of the phones will be available on site.
- The Discussion forum will allow users to discuss about mobiles on the site.
- No intermediate staff required for helping customers in purchasing products. Things are automated.
- Administrators and staff will add new products, edit, update, and delete phone and other details.
- The transactions will be tracked via the administrator’s control panel.
- When a user will purchase a mobile, an automated email will be sent to the administrator and the customer.
- Administrator will send alerts to the members about the latest mobiles on the site automatically.

Tools used in Online Mobile Store:
- A web server which supports ASP.Net v 1.1. Example: IIS 6.0
- Visual Studio 2005
- SQL Server 2000
- HTML
- JavaScript
- CSS
- Intel Pentium 4 1600 GHz processor, 512 MB of Memory.
- An Operating system reliable for a web server with all the security updates installed.
- A Simple Mail Transfer Protocol (SMTP) server

Entity Life History Diagrams

An Entity Life History diagram is used to show the sequencing, iteration or timing of an entity. An Entity Life History (ELH) diagram represents the life cycle of entities within the database.

ELH Diagrams of Online Mobile Store:
Customer Entity Diagram:

Shopping Cart:
Note:
  •  The iterative nature of movement is shown by asterix (*)
  • Any one "movement" must be only one of the optional kinds listed. This is shown by the "o" in the upper right corner.

Process Designing of Online Mobile Store

All processes on the site will be designed and coded in modules, which will enable ease of maintenance and reduce ripple effects on other modules. Each module containing the processes will be included as “server side includes” in the required area and the process will be called “using call statement”.

The main processes and its sub processes are explained below in the form of structured English, which would give a brief idea of the processes LOGIN, ADD TO CART, AND CHECKOUT.

Login

Begin          Login Window
   
    ENTER UserID;
    ENTER Password;

Process
    CHECK UserID AND Password;
       
IF UserID = “ ” OR Password = “ ” OR;
    IF UserID = “Correct” AND Password = “Incorrect” OR;
    IF UserID = “Incorrect” AND Password = “Correct” OR;   
    DISPLAY  “Error Message”;

    ELSE [IF UserID AND Password “Correct”];
            1. CREATE Security Code for the Current Session;
    2. SAVE UserID in Session;
    3. REDIRECT to Home Page with User Details;
       
End Process

Purchasing


Begin Shopping Cart      

    DISPLAY Add to Cart Window;

Process One
    VERIFY that User has been Logged In;
    ELSE REDIRECT to Login Page;   
ELSE
    CREATE Unique TransactionID for the Current Session;
    CHECK the Cart with current UserID, SecurityID, and PhoneID;
CHECK
IF Quantity GREATER THAN 50 OR GREATER THAN stock OR “Text Variable” the in the quantity field;
    DISPLAY “Notification Error Message”;
    ELSE
    IF selected Item Available in cart AMEND Current Item with Existing Item;
    ELSE
    ADD New Item to the Cart;        
    CALCULATE Sub Total;
    CALL Process View Cart;
End of Process One

Process Two    Checkout   
    VERIFY Current UserID, TransactionID, SecurityID; and payment details
       
    IF “Above Verification is Correct”;
    CREATE Unique OrderID;
    SAVE Order Details AND SAVE Item Details;
    DEDUCT Current Item quantity from the Stock;
    IF Selected Item NOT AVAILABLE in Current Stock;
    DISPLAY “Notification Error Message”;    
    CHECK Main Stock Table for Reorder Level;
    NOTIFY User AND Administrator;
    ELSE
    REDERECT to Login Menu;   
    CALL next process;
End of Process Two

Using web.config in Asp.net

Web.config file is the configuration  file for the Asp .net web application. An Asp .net application has minimum configuration file which keeps the configurations required for the corresponding application. Web.config file is written in XML with specific tags having meanings.

Web.config file is stored in Database connections, Session States, Error Handling, Security.

web.config of the Online Mobile Store
<configuration>
    <appSettings>
<add key="MM_CONNECTION_HANDLER_con" value="sqlserver.htm" />
       
        <add key="MM_CONNECTION_DATABASETYPE_con" value="SQLServer" />
        <add key="MM_CONNECTION_SCHEMA_con" value="" />
        <add key="MM_CONNECTION_CATALOG_con" value="" />
    </appSettings>
</configuration>

Now, comes a configuration file of Asp.net

config.aspx

//The runat="server" attribute indicates that the script should be processed on the server
<script runat="server">
sub dbcon
//Change the datasource, username and password    
Bcon = New sqlConnection("data source=micron;uid=sa;pwd=admin;initial catalog=gsmlanka")
cartCon= New sqlConnection("data source=micron;uid=sa;pwd=admin;initial catalog=gsmlanka")
end sub
public BCon As sqlConnection
public cartCon as sqlconnection
public BCmd As sqlCommand
public Mcmd as sqlcommand
public Tcmd as sqlcommand
public pcmd as sqlcommand

public objreader as SqlDataReader
public dr as sqldatareader
public cdr as sqldatareader
public tempdr as sqldatareader
Public intStart As Integer
PUBLIC INSERTSQL AS string
public updatesql as string
</script>

Program Designing of the Online Mobile Store

The programs for the site is developed using Microsoft ASP.Net v1.1, HTML, JavaScript, and CSS. And development tools such as Adobe Dreamweaver, Swish Max, Visual Studio 2005 and MS Notepad are used for the development.

Cascading Style Sheet:
Cascading Style Sheets (CSS) is a stylesheet language used to describe the presentation of a document written in a markup language. CSS can be used locally by the readers of web pages to define colors, fonts, layout, and other aspects of document presentation. It is designed primarily to enable the separation of document content (written in HTML or a similar markup language) from document presentation (written in CSS).

stylesheet.css
TD {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: normal;
}
BODY {
    MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px
}
H1 {
    FONT-SIZE: 26px; MARGIN-LEFT: 10px; TEXT-TRANSFORM: capitalize; COLOR: #ffffff; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif
}
H9 {
    FONT-SIZE: 26px; MARGIN-LEFT: 10px; TEXT-TRANSFORM: capitalize; COLOR: #ffffff; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif
}
H2 {
    FONT-WEIGHT: bold; FONT-SIZE: 13pt; MARGIN-LEFT: 10px; TEXT-TRANSFORM: capitalize; COLOR: #660066; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif
}
H3 {
    FONT-WEIGHT: bold; FONT-SIZE: 12px; MARGIN-LEFT: 10px; TEXT-TRANSFORM: capitalize; COLOR: #660066; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif
}
H4 {
    FONT-WEIGHT: bold; FONT-SIZE: 11px; MARGIN-LEFT: 10px; TEXT-TRANSFORM: capitalize; COLOR: #660066; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif
}
.e {
    MARGIN-LEFT: 10px;
    COLOR: #818181;
    MARGIN-RIGHT: 20px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
}
.leftlink1 {
    MARGIN-LEFT: 9px; MARGIN-RIGHT: 10px
}
.navtenlight {
    FONT-WEIGHT: normal; FONT-SIZE: 9.5px; TEXT-TRANSFORM: capitalize; COLOR: #336699; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-DECORATION: none
}
.navtendark {
    BACKGROUND-COLOR: #D13737;
    }
.navtendark9 {
    BACKGROUND-COLOR: #FF00FF;
}
.leftlink {
    FONT-WEIGHT: normal; FONT-SIZE: 10px; TEXT-TRANSFORM: capitalize; COLOR: #FFFFFF; FONT-FAMILY: Arial, Helvetica, sans-serif; TEXT-DECORATION: none
    }
.leftlink1 {
    FONT-WEIGHT: normal; FONT-SIZE: 9px; TEXT-TRANSFORM: capitalize; COLOR: #336699; FONT-FAMILY: Verdana, arial, helvetica; TEXT-DECORATION: none
}
.leftlink5 {
    FONT-WEIGHT: bold; FONT-SIZE: 11px; TEXT-TRANSFORM: capitalize; COLOR: #336699; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-DECORATION: none
    }
.navtoplight {
}
.navtopdark {
    BACKGROUND-COLOR: #FEA002;
    }
.navtopdark1 {
    BACKGROUND-COLOR: #FECC94;
}
.toplink {
    FONT-WEIGHT: normal;
    FONT-SIZE: 9px;
    TEXT-TRANSFORM: capitalize;
    COLOR: #FFFFFF;
    FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
    TEXT-DECORATION: none;
    }
.toplink1 {
    FONT-WEIGHT: bold; FONT-SIZE: 10px; TEXT-TRANSFORM: capitalize; COLOR: #006699; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-DECORATION: none
}

Types of Testing Used in Online Mobile Store

Testing is the most important part of system development. Every system must be tested for its performance, errors, and efficiency. The site was tested in 3 phases:
  • Unit/module testing
  • Beta testing within local network
  • Testing under a real environment
Unit testing
It focuses on the smallest unit of software design - the software component or module. Using the component level design description as a guide, important control paths are tested to uncover errors within the boundary of the module. The relative complexity of tests and uncovered errors is limited by the constrained scope established for unit testing. The unit test is white-box oriented, and the step can be conducted in parallel for multiple components. The tests that occur as part of unit tests are listed below
  • Module Interface is tested to ensure that information properly flows into and out of the program unit under test. Tests of data flow across a module interface are required before any other test is initiated. If data does not enter and exit properly, all other tests are moot.
  • Local Data Structures are examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithm's execution. 
  • Boundary Conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing. 
  • Independent Paths are exercised to ensure that all statements in a module have been executed at least once. 
  • Error Handling Paths are also tested.
Selective testing of execution paths is an essential task during the unit test. Basis path and loop testing are effective techniques for uncovering a broad array of path errors. Among the more common errors in computation are
- misunderstood or incorrect arithmetic precedence,
- mixed mode operations
- incorrect initialization
- precision inaccuracy
- incorrect symbolic representation of an expression.

Comparison and control flow are closely coupled to one another (i.e., change of flow frequently occurs after a comparison). Test cases should uncover errors such as
- comparison of different data types
- incorrect logical operators or precedence
- expectation of equality when precision error makes equality unlikely
- incorrect comparison of variables
- improper or non-existent loop termination
- failure to exit when divergent iteration is encountered
- improperly modified loop variables

Beta testing within local network

After testing, the website was hosted on the local server of 3 computers and tested for the functionality performance and errors. And the errors found were fixed and tested again. The methods for upgrading the performance and functionality were taken.

Testing under a real environment

After the site was tested in house, the site was hosted for testing under a real environment. And a discussion board named “feedback” was hosted under the forum and the selected 15 beta members were requested to use the site and report any errors or suggestion at the feedback forum. This feedback was used for modifications, and fixing errors.

Error Message Design of the Shopping Cart

Error messages are used to warn users about any errors occurred in a system. These errors can be run time errors which are caused by the user inputs which are invalid or the program errors due to bad programming or even errors because of environmental errors such as failures in operating system, etc.

The typical error message format is using the message boxes. It was decided to avoid message boxes for the reason of slow down of the performance of the website. So, the error messages are designed with the latest web trends for showing errors. All the validations are in the site have used Regular expressions, and control validates which are newly introduced controls in Microsoft .NET platform are used for validations. Some of the error messages used in the site are given below for samples.



Error Message for the Invalid Request


The red asterix (*) used In the site  next to the controls show the field cannot be empty and the filed should be filled.



The Email addresses are validated by the expression given below:

ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"

Aspx Code for the Error Pages:

//-----------------------------------------------------------------------------------------||
// Error page for invalid request                                                           ||
//-----------------------------------------------------------------------------------------||

reqiuesterror.aspx

<%@ Page Explicit="True" Language="VB" Debug="True" %>// Page Directive
<script runat="server">
Sub Page_Load( s As Object, e As EventArgs )

if session("invalidreq")="" then
response.Redirect("index.aspx")
end if

End Sub
</script>

<html >
<head>

<title> ERROR!</title>
<link href="stylesheet1.css" rel="stylesheet1" type="text/css" />

<SCRIPT language=JavaScript
src="javascript.js"></SCRIPT>
<style type="text/css">
<!--
.borderTable {padding: 0px 0px 0px 0px;
border: 1px solid #cccccc;
}
.borderTable {padding: 0px 0px 0px 0px;
border: 1px solid #CCCCCC;
}
-->
</style>
<link href="stylesheet1.css" rel="stylesheet1" type="text/css" />
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
.style3 {font-weight: bold}
-->
</style>
<link href="stylesheet1.css" rel="stylesheet" type="text/css">
</head>

<body><form runat="server">
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="800" height="32" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="307" height="4"></td>
          <td width="493"></td>
        </tr>
      <tr>
        <td height="28" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="imagenew/up_serch_ban.jpg">
          <!--DWLayoutTable-->
          <tr>
                  <td width="153" height="28"><img src="imagenew/1.jpg" width="112" height="28"></td>
              <td width="150" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                <!--DWLayoutTable-->
                <tr>
                  <td width="157" height="28"><font color="#336699">
                    <asp:TextBox ID="txtSearch" Columns="6" width="104px" runat="server" TextMode="SingleLine" />
                    <asp:Button ID="btnSearch" Text="Go" Width="32" runat="server" />
                  </font></td>
                    </tr>
              </table></td>
              <td width="4">&nbsp;</td>
          </tr>
          </table></td>
          <td><table width="100%" height="28" border="0" align="center" cellpadding="0" cellspacing="0" background="imagenew/up_ban.jpg" bgcolor="#FFCC00">
            <!--DWLayoutTable-->
            <tr>
              <td width="60" height="28"
                      align="center" valign="middle" nowrap="nowrap" class="navtopdark1"
                      onclick="jump(this)" onMouseOver="colorOnTop(this)" onMouseOut="colorOffTop(this)"><a class="toplink"
                        href="index.html"><span class="style1">Home</span></a></td>
              <td width="50"
                      align="center" valign="middle" nowrap="nowrap" class="navtopdark1"
                      onclick="jump(this)" onMouseOver="colorOnTop(this)" onMouseOut="colorOffTop(this)"><a class="toplink"
                        href="index.html"><span class="style1">News</span></a></td>
              <td width="58"
                      align="center" valign="middle" nowrap="nowrap" class="navtopdark1"
                      onclick="jump(this)" onMouseOver="colorOnTop(this)" onMouseOut="colorOffTop(this)"><a class="toplink"
                        href="index.html"><span class="style1">Forums</span></a></td>
              <td width="68"
                      align="center" valign="middle" nowrap="nowrap" class="navtopdark1"
                      onclick="jump(this)" onMouseOver="colorOnTop(this)" onMouseOut="colorOffTop(this)"><a class="toplink"
                        href="index.html"><span class="style1">Ringtone</span></a></td>
              <td width="72"
                      align="center" valign="middle" nowrap="nowrap" class="navtopdark1"
                      onclick="jump(this)" onMouseOver="colorOnTop(this)" onMouseOut="colorOffTop(this)"><a class="toplink"
                        href="index.html"><span class="style1">Software</span></a></td>
              <td width="42"
                      align="center" valign="middle" nowrap="nowrap" class="navtopdark1"
                      onclick="jump(this)" onMouseOver="colorOnTop(this)" onMouseOut="colorOffTop(this)"><a class="toplink"
                        href="index.html"><span class="style1">Faq</span></a></td>
              <td width="50"
                      align="center" valign="middle" nowrap="nowrap" class="navtopdark1"
                      onclick="jump(this)" onMouseOver="colorOnTop(this)" onMouseOut="colorOffTop(this)"><a class="toplink"
                        href="index.html"><span class="style1">Links</span></a></td>
              <td width="80"
                      align="center" valign="middle" nowrap="nowrap" class="navtopdark1"
                      onclick="jump(this)" onMouseOver="colorOnTop(this)" onMouseOut="colorOffTop(this)"><a class="toplink"
                        href="index.html"><span class="style1">Contact Us </span></a></td>
              <td width="18">&nbsp;</td>
            </tr>
          </table></td>
      </tr>

    </table></td>
  </tr>
</table>
<table width="799" border="0" align="center" cellpadding="0" cellspacing="0" class="border4">
  <!--DWLayoutTable-->
  <tr>
    <td width="7" height="7"></td>
    <td width="783"></td>
    <td width="7"></td>
  </tr>
  <tr>
    <td height="134"></td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="783" height="134" valign="top"><img src="imagenew/main_ban.jpg" alt="Banner" width="783" height="134" /></td>
        </tr>
    </table></td>
    <td></td>
  </tr>
  <tr>
    <td height="8"></td>
    <td></td>
    <td></td>
  </tr>
</table>
<table width="799" border="0" align="center" cellpadding="0" cellspacing="0" class="border4">
  <!--DWLayoutTable-->
  <tr>
    <td width="7" height="18"></td>
    <td width="783" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="783" height="18"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="f3f3f3">
          <!--DWLayoutTable-->
          <tr>
            <td width="783" height="18">                        </tr>
        </table></td>
          </tr>
    </table></td>
    <td width="7"></td>
  </tr>
  <tr>
    <td height="8"></td>
    <td></td>
    <td></td>
  </tr>
</table>
<table width="799" border="0" align="center" cellpadding="0" cellspacing="0" class="border4">
  <!--DWLayoutTable-->
  <tr>
    <td width="7" height="337"></td>
    <td width="783" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="154" height="105">&nbsp;</td>
        <td width="491">&nbsp;</td>
        <td width="138">&nbsp;</td>
      </tr>
      <tr>
        <td height="62">&nbsp;</td>
        <td valign="top"><div align="center"><span class="redfont">Invalid request!! <br>
          Please check the link you requested..<br>
          or <a href="Index.aspx">click here </a>to go to the home page.<br>
              thank you!.
              </span><br>
            <br>
</div></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="187">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
</table></td>
    <td width="7"></td>
  </tr>
  <tr>
    <td height="7"></td>
    <td></td>
    <td></td>
  </tr>
</table>
<table width="799" border="0" align="center" cellpadding="0" cellspacing="0" background="imagenew/dlink_ban-new-copy.jpg">
  <!--DWLayoutTable-->
  <tr>
    <td width="192" height="28">&nbsp;</td>
      <td width="394" align="center" valign="middle"><span class="style1">Copyright
        &copy; Online Mobile Store</span></td>
    <td width="213">&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p></form>
</body>
</html>

Index Page of the Shopping Cart

This is the front page of the website. The panel in the top of the site is used to navigate between other pages and the site statistics are shown in the statistics panel and other site news and details are shown here. And the news scroller at below left is used to show the latest updated phone on the site.

The panel below the banner shows the user details and the login/logout options.

The menu in the left side of the website, which is called as the phone browser menu, is used to view all phones.

Source Code of Index Page:
Index.aspx

<%@ Page Explicit="True" Language="VB" Debug="True"  %> // Page Directive
<%@ Import Namespace="System.Data" %> //Database connection
<%@ Import Namespace="System.Data.sqlclient" %>  // Creating the Database connection
<!--#include file="config.aspx" --> // Including the files
<!--#include file="scrollerdata.aspx" --> // Each include file has it's own server side script
<!--#include file="man_menu.aspx" -->
<!--#include file="checklogin.aspx" -->
<!--#include file="statistics_site.aspx" -->

//The runat="server" attribute indicates that the script should be processed on the server
<Script Runat="Server">
Sub Page_Load( s As Object, e As EventArgs ) <% --Subroutine Page routine event

call checkstatus
if session("useriD")="" then
btnlogin.text="login"
end if
If Not isPostBack Then
call dbcon
call fillmanu
if session("useriD")="" then
    btnlogin.text="login"
   
end if
call scrollphone
call sitestat
End If
End Sub
</Script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon"
      type="image/png"
      href="favicon.ico">
<meta name="description" content="onlinemobilestore the first srilankan online mobile shop. Find all your latest phones and get them delivered to your door step.">
 <meta name="keywords" content="onlinemobilestore, mobile.phone, phones">
<title>Onlinemobilestore - your online mobile shop, discussion forum and support for mobile users</title>
<link href="stylesheet1.css" rel="stylesheet1" type="text/css" />

//JAVA SCRIPT CODE
<SCRIPT language=JavaScript
src="javascript.js"></SCRIPT>
<style type="text/css">
<!--
.borderTable {padding: 0px 0px 0px 0px;
border: 1px solid #cccccc;
}
.borderTable {padding: 0px 0px 0px 0px;
border: 1px solid #CCCCCC;
}
-->
</style>
<link href="stylesheet1.css" rel="stylesheet1" type="text/css" />
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
.style3 {font-weight: bold}
-->
</style>
<link href="stylesheet1.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style6 {
    font-size: 8px;
    color: #336699;
}
.style7 {color: #FF9900}
.style9 {color: #669940}
.style10 {
    color: #D13737;
    font-weight: bold;
}
.style12 {color: #669940; font-weight: bold; }
-->
</style>
</head>

<body><form runat="server"> //Script to be processed on the server
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="800" height="32" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="307" height="4"></td>
        <td width="493"></td>
      </tr>
      <tr>
        <td height="28" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="imagenew/up_serch_ban.jpg">
            <!--DWLayoutTable-->
            <tr>
              <td width="153" height="28">&nbsp;</td>
              <td width="150" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <!--DWLayoutTable-->
                  <tr>
                    <td width="157" height="28"><font color="#336699">
                      <asp:TextBox ID="txtSearch" Columns="6" width="104px" runat="server" TextMode="SingleLine" />    // Text box Control
 <asp:Button ID="btnSearch" Text="Go" Width="32" runat="server" /> // Button Control   
                    </font></td>
                  </tr>
              </table></td>
              <td width="4">&nbsp;</td>
            </tr>
        </table></td>
        <td><table width="100%" height="28" border="0" align="center" cellpadding="0" cellspacing="0" background="imagenew/up_ban.jpg" bgcolor="#FFCC00">
            <!--DWLayoutTable-->
            <tr>
              <td width="52" height="28"
                      align="center" valign="middle" nowrap="nowrap" class="navtopdark1"
                      onclick="jump(this)" onMouseOver="colorOnTop(this)" onMouseOut="colorOffTop(this)"><a class="toplink"
                        href="index.aspx"><span class="style1">Home</span></a></td>
              <td width="55"
                      align="center" valign="middle" nowrap="nowrap" class="navtopdark1"
                      onclick="jump(this)" onMouseOver="colorOnTop(this)" onMouseOut="colorOffTop(this)"><a class="toplink"
                        href="signup.aspx"><span class="style1">Register</span></a></td>
              <td width="58"
                      align="center" valign="middle" nowrap="nowrap" class="navtopdark1"
                      onclick="jump(this)" onMouseOver="colorOnTop(this)" onMouseOut="colorOffTop(this)"><a class="toplink"
                        href="forum.aspx"><span class="style1">Forums</span></a></td>
              <td width="72"
                      align="center" valign="middle" nowrap="nowrap" class="navtopdark1"
                      onclick="jump(this)" onMouseOver="colorOnTop(this)" onMouseOut="colorOffTop(this)"><a class="toplink"
                        href="orderstatus.aspx"><span class="style1">Track Order </span></a></td>
              <td width="66"
                      align="center" valign="middle" nowrap="nowrap" class="navtopdark1"
                      onclick="jump(this)" onMouseOver="colorOnTop(this)" onMouseOut="colorOffTop(this)"><a class="toplink"
                        href="multimedia.aspx">Multimedia</a></td>
              <td width="42"
                      align="center" valign="middle" nowrap="nowrap" class="navtopdark1"
                      onclick="jump(this)" onMouseOver="colorOnTop(this)" onMouseOut="colorOffTop(this)"><a class="toplink"
                        href="faq.aspx"><span class="style1">Faq</span></a></td>
              <td width="50"
                      align="center" valign="middle" nowrap="nowrap" class="navtopdark1"
                      onclick="jump(this)" onMouseOver="colorOnTop(this)" onMouseOut="colorOffTop(this)"><a class="toplink"
                        href="about.aspx"><span class="style1">About</span></a></td>
              <td width="80"
                      align="center" valign="middle" nowrap="nowrap" class="navtopdark1"
                      onclick="jump(this)" onMouseOver="colorOnTop(this)" onMouseOut="colorOffTop(this)"><a class="toplink"
                        href="contact.aspx"><span class="style1">Contact Us </span></a></td>
              <td width="18">&nbsp;</td>
            </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<table width="799" border="0" align="center" cellpadding="0" cellspacing="0" class="border4">
  <!--DWLayoutTable-->
  <tr>
    <td width="7" height="7"></td>
    <td width="783"></td>
    <td width="7"></td>
  </tr>
  <tr>
Screenshot:

Registration Process of the Shopping Cart

This is the page where new members can join the website. Members must fill all the fields marked with the * and other fields are optional.  Invalid fields are displayed with a red asterix next to the control.


The successful signup of a member will redirect the member to the welcome page of the website.

Source Code of Asp.net for Signup:


//-------------------------------------------------------------------------------||
// Guest can signup. Source code of signup webpage            ||
//-------------------------------------------------------------------------------||

signup.aspx
<%@ Page Explicit="True" Language="VB" Debug="True" %> // Page Directive
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.sqlclient" %>
<%@ Import Namespace="System.Web.Mail" %>

<!--#include file="config.aspx" -->
<!--#include file="registervalidations.aspx" -->
<!--#include file="securetrans.aspx" -->


<html >
<head>
<title> Sign up</title>



<SCRIPT language=JavaScript
src="javascript.js"></SCRIPT>
<style type="text/css">
<!--
.borderTable {padding: 0px 0px 0px 0px;
border: 1px solid #cccccc;
}
.borderTable {padding: 0px 0px 0px 0px;
border: 1px solid #CCCCCC;
}
-->
</style>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
.style3 {color: #CC3300}
.style4 {color: #999999}
.style6 {color: #FF9900}
.style7 {
    color: #000000;
    font-size: 12px;
}
.style8 {color: #336699}
.style9 {color: #003366#336699}
.style11 {color: #FF6600}
-->
</style>
</head>

<body><form runat="server">
<table width="799" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="112" height="38" valign="top"><img src="imagenew/sg_logo.jpg" alt="Logo" width="112" height="38" /></td>
    <td width="586">&nbsp;</td>
      <td width="101" valign="bottom"><div align="right"><span class="address"><a href="index.aspx"><span class="style4"><span class="style6">Home</span></span></a><span class="style4">
          </span></span></div></td>
  </tr>
</table>
<br />
<table width="799" border="0" align="center" cellpadding="0" cellspacing="0" background="imagenew/already_have_id.jpg">
  <!--DWLayoutTable-->
  <tr>
      <td width="275" height="39" align="center" valign="middle" class="address"><span class="style8">Already
        a member</span><span class="style9">? <a href="login.aspx">Sign In</a>.</span>
      </td>
    <td width="105">&nbsp;</td>
    <td width="390" align="center" valign="middle"><asp:Label ID="lblmessege" runat="server" Font-Bold="true" ForeColor="#CC0000" /></td>
    <td width="29">&nbsp;</td>
  </tr>
</table>
<br />
<table width="799" border="0" align="center" cellpadding="0" cellspacing="0" background="imagenew/sml_already_have_id.jpg">
  <!--DWLayoutTable-->
  <tr>
    <td width="799" height="11"></td>
  </tr>
</table>
<table width="799" border="0" align="center" cellpadding="0" cellspacing="0" background="imagenew/sn_bk.jpg" class="border4">
  <!--DWLayoutTable-->
  <tr>
    <td width="210" height="14"><h1 class="style7"><span class="style8">Create
          Your</span> <span class="style3">User</span><span class="style8"> ID</span></h1></td>
    <td width="587"></td>
  </tr>
</table>
<table width="799" border="0" align="center" cellpadding="0" cellspacing="0" background="imagenew/sn_bk.jpg" class="border4">
  <!--DWLayoutTable-->
  <tr>
    <td width="8" height="3"></td>
    <td width="781"></td>
    <td width="8"></td>
  </tr>
  <tr>
    <td height="135"></td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
     
      <tr>
        <td width="14" height="1"></td>
            <td width="165" rowspan="2" align="right" valign="middle"><span class="leftlink2"><span class="style3">*</span><span class="leftlink1">
              <label accesskey="P" for="pw">User ID :</label>
            </span></span></td>
            <td width="9"></td>
            <td width="315"></td>
            <td width="62"></td>
            <td width="96"></td>
            <td width="120"></td>
      </tr>
      <tr>
        <td height="20"></td>
        <td></td>
        <td colspan="3" rowspan="2" valign="top"><asp:TextBox ID="txtUserid" runat="server" Width="150" MaxLength="20" />                       
          <asp:requiredfieldvalidator id="chuserid" errormessege="userID cannot be blank" text="*" Font-Bold="true" Font-Size="12" controltovalidate="txtUserid" runat="server"></asp:requiredfieldvalidator>
          
              <br>

              <asp:RegularExpressionValidator id="nospace" ErrorMessage="no spaces please" text="* user id cannot contain spaces" ControlToValidate="txtuserid" ValidationExpression="\S*" runat="server"></asp:RegularExpressionValidator>        </td>
            <td>&nbsp;</td>
      </tr>

      <tr>
        <td height="14"></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>
      <tr>
        <td height="12"></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
      </tr>

Login Screen of the Shopping Cart

This is the page where registered members are required to log in to the site. Invalid  details will not allow the members to login to the site and invalid attempts will be displayed with an error message.

On the login of a member, a unique security code is generated for this session which will be used for the security reasons in shopping carts if the user intend to purchase anything online. The logged in user will be redirected to the homepage with the member details.

//---------------------------------------------------------------------||
// This is the code of loginpage of website              ||
//---------------------------------------------------------------------||



login.aspx
<%@ Page Explicit="True" Language="VB" Debug="True"  %> // Page Directive
<%@ Import Namespace="System.Data" %> //Database connection
<%@ Import Namespace="System.Data.sqlclient" %> //Creating Database connection
<!--#include file="config.aspx" -->
<!--#include file="securetrans.aspx" -->
<!--#include file="verify.aspx" -->
<Script Runat="Server">
Sub Page_Load( s As Object, e As EventArgs )
lblmessege.text=""
If Not isPostBack Then
if session("checklog")=true then
lblerror.text="You are not logged in to access the feature you requested"
lblerror.visible="true"
else
lblerror.visible="false"
end if
lblmessege.text=""
end if
End Sub
</Script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon"
      type="image/ico"
      href="favicon.ico">

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title> Sign in</title>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />


<SCRIPT language=JavaScript
src="javascript.js"></SCRIPT>
<style type="text/css">
<!--
.borderTable {padding: 0px 0px 0px 0px;
border: 1px solid #cccccc;
}
.borderTable {padding: 0px 0px 0px 0px;
border: 1px solid #CCCCCC;
}
-->
</style>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style2 {color: #336699}
-->
</style>
</head>

<body><form runat="server">
  <p>&nbsp;</p>
  <table width="798" border="0" align="center" cellpadding="0" cellspacing="0" background="imagenew/full_up_line.jpg">
  <!--DWLayoutTable-->
  <tr>
    <td width="798" height="45">&nbsp;</td>
    </tr>
</table>
<table width="798" border="0" align="center" cellpadding="0" cellspacing="0" class="border4">
  <!--DWLayoutTable-->
  <tr>
    <td width="9" height="332">&nbsp;</td>
    <td width="771" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
     
      <tr>
        <td width="96" height="24">&nbsp;</td>
            <td width="379" valign="top"><asp:Label ID="lblerror"  runat="server"  /></td>
        <td width="12">&nbsp;</td>
          <td width="284">&nbsp;</td>
          </tr>
      <tr>
        <td colspan="2" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->