Unit I Final
Unit I Final
E- Commerce
DEPARTMENT OF INFORMATION TECHNOLOGY
REGULATION 2017
SEMESTER: 8
Ms Anju A
Assistant Professor,
IT Department
UNIT I
INTRODUCTION TO E-COMMERCE AND TECHNOLOGY
INFRASTRUCTURE
Working of Web - HTML Markup for Structure - Creating simple page - Marking
up text - Adding Links - Adding Images - Table Markup - Forms - HTML5
• Web Essentials:
– Clients
– Servers
– Communication
• Basic Internet Protocols :
– IP,TCP,UDP,DNS
World Wide Web:
– HTTP request message-response message
• Web Clients
• Web Servers
• Markup Languages:
– XHTML.
– HTML
– XHTML Syntax and Semantics
• Some Fundamental HTML Elements
- Relative URLs
- Lists
- tables
- Frames
- Forms
- HTML 5.0.
DEFINITION
Web technology refers to the means by which computers communicate
- TCP/IP
- UDP
Access Control.
Port Address
A port number is a 16 bit address used to identify any client-server
program uniquely.
The transport layer is also responsible for creating the end-to-end
connection between hosts for which it mainly uses TCP and UDP .
Socket Address
A socket address object identifies a socket endpoint for
communication
Packet
A packet is a small amount of data sent over a network, such as
a LAN or the Internet.
Each packet includes a source and destination as well as the
content (or data) being transferred.
Gateway (Protocol Converter)
A gateway is a node (router) in a computer network, a key
stopping point for data on its way to or from other networks.
Route
A router is a networking device that forwards
data packets between computer networks
checksum
IP also adds some error detection information to each
packet it creates, so that if a packet is corrupted
during transmission, this can usually be detected by
the recipient.
UDP(User Datagram Protocol)
• UDP is a connectionless protocol
• UDP provides a process to process communication.
• Port numbers are appended in the header of the packet to enable this.
• There is no handshaking required before sending a message.
• UDP is a best-effort delivery service – it does not transmit any lost or
corrupt packets.
• A packet contains a checksum field that is used to detect a corrupted
datagram.
• It has relatively limited error detection abilities.
UDP Packet Format
DNS (Domain Name System)
The Domain Name System (DNS) is the phonebook of the Internet.
Humans access information online through domain names, like
nytimes.com or espn.com.
Web browsers interact through Internet Protocol (IP) addresses.
DNS translates domain names to IP addresses so browsers can load
Internet resources.
www.example.org is a fully qualified domain name for a host with local name www
that belongs to the example second-level domain of the org top-level domain.
nslookup is a simple but very practical command-line tool, which is principally used to
find the IP address that corresponds to a host, or the domain name that corresponds to an
IP address.
High Level Protocols
World Wide Web
The World Wide Web is a way of exchanging information
between computers on the Internet, tying them together into a
30
Communication on web
1. Client (browser) to
webserver
HTTP (Hyper Text Transfer Protocol)
URI,URN,URL
Uniform Resource Identifier
How to find the resource, a URI that says how to find the resource
Complete URL format
Uniform Resource Identifier (URI)
https://www.google.com/search/how-to-fix-baked-beans.html#search
Uniform Resource Locator (URL)
https://www.google.com/search/how-to-fix-baked-beans.html
Uniform Resource Name (URN)
www.google.com/search/how-to-fix-baked-beans.html#search
HTTP Request Message Structure
Request line
GET /test.html HTTP/1.1
• Methods
– GET
• retrieve a URL from the server
– simple page request
– POST
• preferred method for forms processing
• run a CGI program
• more secure and private
HTTP - methods
Methods (cont.)
PUT
HEAD
HTTP/1.1 200 OK
characters are represented by integer values within a computer.
A character set defines the mapping between these integers, or code points, and characters.
US-ASCII [RFC-1345] is the character set used to represent the characters used in HTTP header field names,
Each US-ASCII character can be represented by a 7-bit integer.
The messages transmitted by the Internet Protocol are viewed as streams of 8-bit bytes.
The Unicode Standard is an attempt to provide a single character set that encompasses every human
A character encoding is a bit string that must be decoded into a code-point integer that is then mapped to a
For example, UTF-8 and UTF-16 are encodings of the character set in Unicode that use variable numbers of
• Virtual Host refers to the practice of running more than one web site (such
as company1.example.com and company2.example.com) on a single machine.
• Virtual hosts can be "IP-based", meaning that you have a different IP address for
every web site, or "name-based", meaning that you have multiple names running on
each IP address.
Defining Virtual Hosts
The Host component is used to define a virtual
host
Logging
• Web server logs record information about server activity.
• The primary web server log recording normal activity is an access log, a file that records
information about every HTTP request processed by the server.
• A web server may also produce one or more message logs containing a variety of debugging
and other information generated by web applications as well as possibly by the web server
itself.
• Information written to the standard output and error streams by the web server or applications
may also be logged.
Access Control
Tomcat can provide automatic password protection for resources that it serves.
This is a two-stage process.
First, a database of user names is created.
Each user name is assigned a password and a list of roles.
Secure Servers
• Normally, the HTTP request and response messages are sent as simple text files.
• These messages are carried by TCP/IP, each message may travel through a number of
machines before reaching its destination.
• It is possible that some machine along the route will extract information from the IP
messages it forwards for important purposes.
• Any machine other than the sender or receiver that extracts information from network
messages is known as an eavesdropper
To prevent eavesdroppers from obtaining sensitive information, such as credit card numbers,
all such sensitive information should be encrypted before being transmitted over any public
communication network.
The standard means of indicating to a browser that it should encrypt an HTTP request is to
the text.
Website
A website is a collection of web pages.
Webpage
• A web page may contain texts, graphics, sounds, animations,
and movies.
• Web pages are developed with the help of a language called
Hyper Text Markup Language(HTML).
• It is also a language of Internet.
How is this website made available on the Internet?
These web pages are to be stored in web servers connected to the Internet,
• All tags are specified either start tags < > or end tags < />
– Tags are an example of markup, that is, text treated specially by the
browser
– Non-markup text is called character data and is normally displayed by the
browser
XHTML 1.0
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Example1
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
heading
<html>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
</body>
</html>
Paragaraph
<html>
<body>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</body>
</html>
• All HTML elements can have attributes
• Attributes provide additional information about elements
• Attributes are always specified in the start tag
• Attributes usually come in name/value pairs
like: name="value“
<h2>HTML Images</h2>
<p>HTML images are defined with the img tag:</p>
</body>
</html>
Empty HTML Elements
<html>
<body>
<p>This is a <br> paragraph with a line break.</p>
</body>
</html>
Style attributes
<html>
<body>
</body>
</html>
HTML Horizontal Rules
<html>
<body>
<h1>This is heading 1</h1>
<p>This is some text.</p>
<hr>
<h2>This is heading 2</h2>
<p>This is some other text.</p>
<hr>
<h2>This is heading 2</h2>
<p>This is some other text.</p>
</body>
</html>
<pre> tag
<html>
<body>
<p>The pre tag preserves both spaces and line breaks:</p>
<p>
My Bonnie lies over the ocean.
My Bonnie lies over the sea.
My Bonnie lies over the ocean.
Oh, bring back my Bonnie to me.
</p>
<hr>
<pre>
My Bonnie lies over the ocean.
My Bonnie lies over the sea.
My Bonnie lies over the ocean.
Oh, bring back my Bonnie to me.
</pre>
</body>
</html>
Background Color
<html>
<body style="background-color:powderblue;">
</body>
</html>
Text Color
<html>
<body>
<h1 style="color:yellow;">This is a heading</h1>
<p style="color:red;">This is a paragraph.</p>
</body>
</html>
Fonts
<html>
<body>
<h1 style="font-family:Times New Roman;">This is a heading</h1>
<p style="font-family:courier;">This is a paragraph.</p>
</body>
</html>
Text Size
<html>
<body>
<h1 style="font-size:400%;">This is a heading</h1>
<p style="font-size:160%;">This is a paragraph.</p>
</body>
</html>
Text Alignment
<html>
<body>
<h1 style="text-align:left;">left Heading</h1>
<p style="text-align:center;">Centered paragraph.</p>
<p style="text-align:right;">right paragraph.</p>
</body>
</html>
HTML Formatting Elements
<b> - Bold text
<strong> - Important text
<i> - Italic text
<em> - Emphasized text
<mark> - Marked text
<small> - Smaller text
<del> - Deleted text
<ins> - Inserted text
<sub> - Subscript text
• <sup> - Superscript text
example
<html>
<body>
<p>This text is normal.</p>
<p><b>This text is bold.</b></p>
<strong>This text is important!</strong><br>
<i>This text is italic</i>
<small>This is some smaller text.</small>
<p>Do not forget to buy <mark>milk</mark> today.</p>
<p>My favorite color is <del>blue</del> red.</p>
<p>My favorite color is <del>blue</del> <ins>red</ins>.
<p>This is <sub>subscripted</sub> text.</p>
<p>This is <sup>superscripted</sup> text.</p>
</p>
</body>
</html>
HTML Comments
For example, if storing a file called KeySound.txt in the My Documents folder, the
KeySound.txt.
\KeySound
HTML Lists
An ordered list starts with the <ol> tag. Each list item starts with
the <li> tag.
The list items will be marked with numbers by default:
<html>
<body>
<h2>An ordered HTML list</h2>
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Optional Attributes
HTML Description Lists
• HTML also supports description lists.
• A description list is a list of terms, with a description of
each term.
• The <dl> tag defines the description list,
<html>
<body>
<h2>Ordered List with Lowercase Letters</h2>
<ol type="a">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Uppercase Roman Numbers
<html>
<body>
<h2>Ordered List with Roman Numbers</h2>
<ol type="I">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Lowercase Roman Numbers
<html>
<body>
<h2>Ordered List with Lowercase Roman Numbers</h2>
<ol type="i">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
HTML Tables
143
Defining a Table Structure
The first step to creating a table is to specify
the table structure:
the number of rows and columns
the location of column headings
the placement of a table caption
144
Using the <table>, <tr>, and <td> Tags
Graphical tables are enclosed within a two-
sided <table> tag that identifies the start
and ending of the table structure.
Each row of the table is indicated using a two-
sided <tr> (for table row).
Within each table row, a two-sided <td> (for
table data) tag indicates the presence of
individual table cells.
145
The General Table Syntax
<table>
<tr>
<td> First Cell </td>
<td> Second Cell </td>
</tr>
<tr>
<td> Third Cell </td>
<td> Fourth Cell </td>
</tr>
</table>
two
rows
two
146
columns
Example
<html>
<body>
<h2>Basic HTML Table</h2>
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
</table>
</body>
</html>
HTML Structure of a Table
beginning of
the table
structure
table cells
end of the
table structure
148
Creating Headings with the <th> Tag
Text formatted with the <th> tag is centered within the cell and displayed in a
boldface font.
The <th> tag is most often used for column headings, but you can use it for any
149
Adding Table Headings to the Table
table
headings
150
Creating a Table Caption
HTML allows you to specify a caption for a table.
The syntax for creating a caption is: <caption
align=“alignment”>caption text</caption>
alignment indicates the caption placement
a value of “bottom” centers the caption below the table
a value of “top” or “center” centers the caption above the table
a value of “left” or “right” place the caption above the table to
the left or right
151
Result of a Table Caption
caption text
caption will be
centered above
the table
152
Tables with Different Borders
Values
This figure shows the effect on a table’s border when the border size is varied.
153
Adding a 5-Pixel Border to a Table
154
Controlling Cell Spacing
• The cellspacing attribute controls the amount of space inserted
between table cells.
• The syntax for specifying the cell space is:
<table cellspacing=“value”>
155
Defining Cell Padding
• To control the space between the table text and the cell borders, add the cellpadding
attribute to the table tag.
• The syntax for this attribute is:
<table cellpadding=“value”>
– value is the distance from the table text to the cell border, as measured in pixels
– the default cell padding value is 1 pixel
156
Tables with Different
Cell Spacing Values
different cell spacing values
157
Creating Frames and Rules
Continued
The rules attribute lets you control how the
table gridlines are drawn (not supported by
Netscape)
The syntax of the rules attribute is:
<table rules=“type”>
type is either
the effect of each“all”,
of the“rows”, “cols”,
rules attribute oron
values “none”
a table
158
A Table Structure with a Row-Spanning Cell
four table
cells in the
first row
HTML
code
resulting
159
table
Adding Spanning Cells to a Table
160
Applying a Background Color
Table elements support the bgcolor attribute.
To specify a background color for all of the cells in a table, all of the
cells in a row, or for individual cells, by adding the bgcolor attribute
to either the <table>, <tr>, <td>, or <th> tags as follows:
<table bgcolor=“color”>
<tr bgcolor=“color”>
<td bgcolor=“color”>
<th bgcolor=“color”>
color is either a color name or hexadecimal color value
161
Colors
Specifying Table, Row, and Cell
Colors
The bordercolor Attribute
By default, table borders are displayed in two shades of gray
that create a three-dimensional effect.
The syntax for the bordercolor attribute is:
<table bordercolor=“color”>
color is an HTML color name or hexadecimal color value
Internet Explorer and Netscape apply this attribute
differently.
<table border=“10” bordercolor=“blue”>
Internet Netsca
164 Explorer pe
Applying a Table Background
Add a background image to your tables using the
background attribute.
A background can be applied to the entire table or to a cell.
parch.jp
g
<table <td
background=“parch.jpg”> background=“parch.jpg”>
165
Sample Template based on Class Web Page
Frames
HTML frames
HTML frames are used to divide your browser window into
multiple sections where each section can load a separate
HTML document.
A collection of frames in the browser window is known as a
frameset.
The window is divided into frames in a similar way the tables
are organized:
into rows and columns.
Advantages / Disadvantages of Frames
Advantages
Allow multiple content on a
Disadvantages
169
Creating Frames
<html>
<head>
<title>HTML Frames</title>
</head>
<frameset rows = "10%,80%,10%">
<frame name = "top" src = "a.html" />
<frame name = "main" src = "b.html" />
<frame name = "bottom" src = "c.html"/>
<noframes>
<body>Your browser does not support frames.</body>
</noframes>
</frameset>
</html>
Basics of Frame Design - content of frame1.htm file
<HTML>
<HEAD><TITLE>Frame example</TITLE></HEAD>
<FRAMESET ROWS="100,*">
<FRAME NAME="top_row" SRC="frame1top.htm">
<FRAME NAME="bottom_row" SRC="frameintro.htm">
</FRAMESET>
</HTML>
Notice - there is NOT a <BODY> … </BODY> tag set in
the frame definition. This is NOT a mistake in the example
code.
171
Defining the frameset
<HTML>
<HEAD><TITLE>Frame example</TITLE></HEAD>
<FRAMESET ROWS="100,*">
<FRAME NAME="top_row" SRC="frame1top.htm">
<FRAME NAME="bottom_row" SRC="frameintro.htm"
</FRAMESET>
</HTML>
•The Frameset tags define that this frame will have two rows.
•The top row will be 100 pixels tall, the second row will receive whatever space
172
remains.
Defining the Frame
<HTML>
<HEAD><TITLE>Frame example</TITLE></HEAD>
<FRAMESET ROWS="100,*">
<FRAME NAME="top_row" SRC="frame1top.htm">
<FRAME NAME="bottom_row" SRC="frameintro.htm"
</FRAMESET>
</HTML>
•The FRAME tags define the two rows of the frame.
•The name entry is technically optional, but highly recommended.
•The SRC tag defines the content of the frame when the frameset is initially
loaded.
173
Defining the bottom row
<HTML>
<HEAD><TITLE>Frame example</TITLE></HEAD>
<FRAMESET ROWS="100,*">
<FRAME NAME="top_row" SRC="frame1top.htm">
<FRAME NAME="bottom_row" SRC="frameintro.htm"
</FRAMESET>
</HTML>
This Frame tag defines the bottom of the browser window, which will be
the "large size" window on the screen.
The name entry (bottom_row) shows up in links in the frame1top.htm file.
The initial content of the is defined in the SRC tag entry.
174
Opening of frame page
Rows
It is used to specify the rows in the frameset.
rows = "10%, 90%".
Border
This attribute specifies the width of the border of each frame in pixels
Frameborder
This attribute specifies whether a three-dimensional border should be displayed between frames
Framespacing
This attribute specifies the amount of space between frames in a frameset.
The <frame> Tag Attributes
<html>
<body>
<h2>HTML Iframes</h2>
<p>You can use the height and width attributes to specify the size of
the iframe:</p>
<iframe src="a.html" height="200" width="300" title="Iframe
Example"></iframe>
</body>
</html>
HTML Forms
HTML form
An HTML form is used to collect user input.
The user input is most often sent to a server for processing.
<html>
<body>
<h2>HTML Forms</h2>
<form action="/action_page.php">
</form>
</body>
</html>
Parts of a Web Form
• A Form is an area that can contain Form Control/Elements.
• buttons,
• checkboxes,
• text fields,
• radio buttons,
– A form usually contains a Submit button to send the information in the form elements to the
server
Control Elements
Input Boxes – for text and numerical entries
Option Buttons, also called Radio Buttons – for selecting a single option from a
predefined list
Selection Lists – for long lists of options, usually appearing in a Drop-Down List
Box
Text Areas – for extended entries that can include several lines of text
185
HTML Forms
• The basic construction of a HTML form is
this...
186
Forms and Server-Based Programs
Forms are used to collect information.
By giving users access to programs that react to user input, the Web became a more
187
Text Input (type=“text”)
• A Text Field:
– used to create one line fields that viewers can type text.
– The default width is 20 characters, and you can create fields of other sizes by
the value in the size option. Y
– you can limit the number of characters by the value of the MAXLENGTH
option.
– Text input fields will be empty when the page loads, unless you provide an
initial text string for its VALUE option
188
Text Input (type=“text”)
Example 1: A text field named "text1" that is 30 characters wide.
<input type="text" name="text1" size="30">
189
Password Input (type=“password”)
Example 4: A password field named "pass1" that is 30 characters wide
190
Text Input (type=“textarea”)
Example 6: A textarea field named "comments" that is 45 characters
wide and 6 lines high
<textarea name="comments" rows="6" cols="45" wrap="virtual">
The first time I ever saw a web page, I thought.... (continue)
</textarea>
191
Adding Control Buttons
A submit button:
<input type="submit" name="Submit" value="Submit">
A reset button:
<input type="reset" name="Submit2" value="Reset">
Radio buttons:<br>
<input type="radio" name="radiobutton" value="myValue1">
male<br>
<input type="radio" name="radiobutton" value="myValue2" checked>
female
193
Checkboxes (type=“checkbox”)
A checkbox:
<input type="checkbox" name="checkbox”
value="checkbox" checked>
Drop-down menu or list
A menu or list:
<select name="select">
<option value="red">red</option>
<option value="green">green</option>
<option value=“blue">blue</option>
</select>
195
A complete example
<html>
<head>
<title>Get Identity</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body>
<p><b>Who are you?</b></p>
<form method="post" action="">
<p>Name:
<input type="text" name="textfield">
</p>
<p>Gender:
<input type="radio" name="gender" value="m">Male
<input type="radio" name="gender" value="f">Female</p>
</form>
</body>
</html>