Web Notes Unit 1 - Modified1
Web Notes Unit 1 - Modified1
Origins During 1960s o U.S. Department of Defence (DoD) became interested in developing a new large-
scale computer network.
o The purposes of this network were communications, program sharing, and remote computer access for
researchers working on defence-related contracts. o The DoD’s Advanced Research Projects Agency (ARPA)
funded the construction of the first such network.
Hence it was named as ARPAnet.
o The primary early use of ARPAnet was simple text-based communications through e-mail.
Late 1970s and early 1980s o BITNET, which is an acronym for Because It’s Time NETwork, began at the City
University of New York. It was built initially to provide electronic mail and file transfers. o CSNET is an acronym
for Computer Science NETwork. Its initial purpose was to provide electronic mail.
1990s o NSFnet which was created in 1986 replaced ARPAnet by 1990. o It was
sponsored by the National Science Foundation (NSF). o By 1992 NSFnet,
connected more than 1 million computers around the world.
o In 1995, a small part of NSFnet returned to being a research network. The rest became known as the Internet.
Domain Names
The IP addresses are numbers. Hence, it would be difficult for the users to remember IP address. To solve this problem,
text based names were introduced. These are technically known as domain name system (DNS).
These names begin with the names of the host machine, followed by progressively larger enclosing collection of
machines, called domains. There may be two, three or more domain names. DNS is of the form
hostname.domainName.domainName . Example: rnsit.ac.in The steps for conversion from DNS to IP:
Origins
▪ Tim Berners Lee and his group proposed a new protocol for the Internet whose intention was to allow scientists
around the world to use the Internet to exchange documents describing their work.
▪ The proposed new system was designed to allow a user anywhere on the Internet to search for and retrieve
documents from the databases on any number of different document-serving computers.
▪ The system used hypertext, which is text with embedded links to text in other documents to allow non-
sequential browsing of textual material.
▪ The units of web are referred as pages, documents and resources.
▪ Web is merely a vast collection of documents, some of which are connected by links.
▪ These documents can be accessed by web browsers and are provided by web servers.
Web or Internet?
It is important to understand that the Internet and the Web is not the same thing.
✓ The Internet is a collection of computers and other devices connected by equipment that allows them to
communicate with each other.
✓ The Web is a collection of software and protocols that has been installed on most, if not all, of the computers
on the Internet.
WEB BROWSERS
* Documents provided by servers on the Web are requested by browsers, which are programs running on client
machines.
* They are called browsers because they allow the user to browse the resources available on servers.
* Mosaic was the first browser with a graphical user interface.
* A browser is a client on the Web because it initiates the communication with a server, which waits for a request
from the client before doing anything.
* In the simplest case, a browser requests a static document from a server.
* The server locates the document among its servable documents and sends it to the browser, which displays it for
the user.
* Sometimes a browser directly requests the execution of a program stored on the server. The output of the
program is then returned to the browser.
* Examples: Internet Explorer, Mozilla Firefox, Netscape Navigator, Google Chrome, Opera etc.,
Apache
Apache is the most widely used Web server.
The primary reasons are as follows: Apache is an excellent server because it is both fast and reliable.
Furthermore, it is open-source software, which means that it is free and is managed by a large team of
volunteers, a process that efficiently and effectively maintains the system.
Finally, it is one of the best available servers for Unix-based systems, which are the most popular for Web servers.
Apache is capable of providing a long list of services beyond the basic process of serving documents to clients.
When Apache begins execution, it reads its configuration information from a file and sets its parameters to operate
accordingly.
▪ This helper application will be used for rendering the document by browser.
▪ The list of MIME specifications is stored in configuration file of web server.
The format of a header field is the field name followed by a colon and the value of the field. There are four categories
of header fields:
1. General: For general information, such as the date
2. Request: Included in request headers
-+ O0\
M
The Host: host name request field gives the name of the host. The Host field is required for HTTP 1.1. The If-
Modified-Since: date request field specifies that the requested file should be sent only if it has been modified
since the given date. If the request has a body, the length of that body must be given with a Content- length
field. The header of a request must be followed by a blank line, which is used to separate the header from the body
of the request.
The Response Phase:
The general form of an HTTP response is as follows:
1. Status line
2. Response header fields
3. Blank line
4. Response body
The status line includes the HTTP version used, a three-digit status code for the response, and a short textual
explanation of the status code. For example, most responses begin with the following: HTTP/1.1 200 OK
The status codes begin with 1, 2, 3, 4, or 5. The general meanings of the five categories specified by these first digits
are shown in below table
One of the more common status codes is one user never want to see: 404 Not Found, which means the requested
file could not be found.
SECURITY
Security is one of the major concerns in the Internet. The server system can be accessed easily with basic hardware
support, internet connection & web browser. The client can retrieve very important information from the server.
Similarly, the server system can introduce virus on the client system. These viruses can destroy the hardware and
software in client. While programming the web, following requirements should be considered:
▪ Privacy: it means message should be readable only to communicating parties and not to intruder.
▪ Integrity: it means message should not be modified during transmission.
▪ Authentication: it means communicating parties must be able to know each other’s identity
▪ Non-repudiation: it means that it should be possible to prove that message was sent and received properly
Security can be provided using cryptographic algorithm. Ex: private key, public key Protection against viruses
and worms is provided by antivirus software, which must be updated frequently so that it can detect and
protect against the continuous stream of new viruses and worms.
ASP.NET is a Web development framework. The code used in ASP.NET documents, which is executed on the
server, can be written in any .NET programming language.
Ruby is a relatively recent object-oriented scripting language that is introduced here primarily because of its use
in Rails, a Web applications framework.
Rails provides a significant part of the code required to build Web applications that access databases, allowing
the developer to spend his or her time on the specifics of the application without the drudgery of dealing with all
of the housekeeping details.
HTML AND XHTML
HTML → Hyper Text Mark-up Language
XHTML → eXtensible Hyper Text Mark-up Language
HTML XHTML
1. HTML is much easier to write. 1. XHTML requires a level of discipline.
2. Huge number of HTML documents available 2. Many of us naturally resist some older
on the web browsers will continue to browsers have problems with some parts of
support HTML as far as one can see into the XHTML.
future.
3. HTML has few syntactic rules, and HTML 3. XHTML has strict syntactic rules that
processors (e.g., browsers) do not enforce impose a consistent structure on all
the rules it does have. XHTML documents.
4. Therefore, HTML authors have a high degree 4. Another significant reason for using XHTML
of freedom to use their own syntactic is that when you create an XHTML
preferences to create documents. Because document, its syntactic correctness can be
of this freedom, HTML documents lack checked, either by an XML browser or by a
consistency, both in low-level syntax and in validation tool.
overall structure.
5. Used for displaying the data 5. Used for describing the data
BASIC SYNTAX
▪ The fundamental syntactic units of HTML are called tags.
▪ In general, tags are used to specify categories of content.
▪ The syntax of a tag is the tag’s name surrounded by angle brackets (< and >).
Block Quotations:
The <blockquote> tag is used to make the contents look different from the surrounding text. <html>
<head>
<title> Blockquotes </title>
</head>
<body>
<h2>This is an example of blockquotes</h2>
<blockquote>
<p>
Twinkle Twinkle little star How
I wonder what you are?
</p>
</blockquote>
<p>
Twinkle Twinkle little star How
I wonder what you are?
</p>
</body>
</html>
<html>
<head>
<title> font styles and sizes </title>
</head>
<body>
<p>
<pre> Illustration of Font Styles
<b> This is Bold </b>
<i> This is Italics </i>
<u> This is Underline </u>
<em> This is Emphasis </em>
<strong> This is strong </strong>
<code> Total = Internals + Externals //this is code</code>
</pre>
</p>
<p>
<pre> Illustration of Font Sizes (subscripts and superscripts)
x<sub>2</sub><sup>3</sup> + y<sub>1</sub><sup>2</sup>
</pre>
</p>
</body>
</html>
Character Entities:
XHTML provides a collection of special characters that are sometimes needed in a document but cannot be typed as
themselves. In some cases, these characters are used in XHTML in some special way—for example, >, <, and &. In other
cases, the characters do not appear on keyboards, such as the small raised circle that represents “degrees” in a reference
to temperature. These special characters are defined as entities, which are codes for the characters. An entity in a
document is replaced by its associated character by the browser. <html>
<head>
<title> Character Entities </title>
</head>
<body>
<p>
<pre> Illustration of character entities if you
get > 70%, then you will get FCD if you
get < 35%, then you are Fail ½ of my
classmates get very good marks
Now, the temperature in Bangalore is 30° C
</pre>
</p>
</body>
</html> Horizontal
Rules:
The parts of a document can be separated from each other, making the document easier to read, by placing horizontal
lines between them. Such lines are called horizontal rules. The block tag that creates them is <hr />. The <hr /> tag causes
a line break (ending the current line) and places a line across the screen. Note again the slash in the <hr /> tag, indicating
that this tag has no content and no closing tag.
<html>
<head>
<title> Horizontal Rule </title>
</head>
<body> <p>
This is an illustration of horizontal rule<hr/> This is line 2<hr/> This is
line 3 <hr/> This is line 4 <hr/>
</p>
</body>
</html>
<html>
<head>
<title>display image</title>
</head>
<body>
<img src="java.png" alt="cannot display"/>
</body>
</html>
HYPERTEXT LINKS
Links:
▪ Hyperlinks are the mechanism which allows the navigation from one page to another.
▪ The term “hyper” means beyond and “link” means connection
▪ Whichever text helps in navigation is called hypertext
▪ Hyperlinks cam be created using <a> (anchor tag)
▪ The attribute that should be used for <a> is href Program: hyper.html
<html>
<head>
After clicking on the above text, we can navigate to another page “link.html” as shown below
<html>
<head>
<title> target link</title>
</head>
<body>
<h1> Puneeth Rajkumar </h1>
<a href = "#bottom"> Click Here For His Autobiography </a> <p>
<pre>
Appu Abhi
Veera Kannadiga Maurya Akaash Namma Basava Ajay Arasu Milana Bindaas Vamshi Raaj Raam Prithvi Jackie
Hudugaru Paramathma Anna Bond
</pre>
</p>
<h2> AutoBiography </h2>
<p id = "bottom">
<pre>
Puneeth Rajkumar was born on 17th of March, 1975. His father Dr. Rajkumar is the Legend of Kannada Film
Industry. His mother is Smt. Parvathamma Rajkumar who is a renowned producer in the industry. His brothers
ShivaRajkumar and Raghavendra Rajkumar are very popular heroes. He is married to Smt. Ashwini Revnath He
has two daughters namely Dhrithi and Vanditha.. At present, Puneeth is the greatest star of Kannada Film Industry.
</pre>
</p>
LISTS
Unordered Lists:
The <ul> tag, which is a block tag, creates an unordered list. Each item in a list is specified with an <li> tag (li is an
acronym for list item). Any tags can appear in a list item, including nested lists. When displayed, each list item is
implicitly preceded by a bullet.
Square, Circle or Disc any type of bullet can used in unordered list.
Example:
<ul type=”square”>
<li>Apple</li>
<li>Mango</li>
</ul>
Ordered Lists:
Ordered lists are lists in which the order of items is important. This ordered ness of a list is shown in the display of
the list by the implicit attachment of a sequential value to the beginning of each item. The default sequential values
are Arabic numerals, beginning with 1.
An ordered list is created within the block tag <ol>.
The items are specified and displayed just as are those in unordered lists, except that the items in an ordered list are
preceded by sequential values instead of bullets. Sequential values like A,a,I,i,1 by default it begins with 1.
Example:
<ol type=’a’>
<li>Cucumber</li>
<li>Carrot</li>
</ol>
Definition Lists:
As the name implies, definition lists are used to specify lists of terms and their definitions, as in glossaries. A definition
list is given as the content of a <dl> tag, which is a block tag. Each term to be defined in the definition list is given
as the content of a <dt> tag.
The definitions themselves are specified as the content of <dd> tags. The defined terms of a definition list are usually
displayed in the left margin; the definitions are usually shown indented on the line or lines following the term.
TABLES IN HTML
A table is a matrix of cells. The cells in the top row often contain column labels, those in the leftmost column often
contain row labels, and most of the rest of the cells contain the data of the table. The content of a cell can be almost
any document element, including text, a heading, a horizontal rule, an image, and a nested table. Basic Table
Tags:
▪ A table is specified as the content of the block tag <table>.
▪ There are two kinds of lines in tables: the line around the outside of the whole table is called the border; the lines
that separate the cells from each other are called rules.
▪ It can be obtained using border attribute. The possible values are “border” or any number.
▪ The table heading can be created using <caption> tag.
▪ The table row can be created using <tr> tag.
▪ The column can be created either by using <th> tag (stands for table header which is suitable for headings) or
<td> tag (stands for table data which is suitable for other data). <html>
<head>
<title> Table with text and image </title>
</head>
<body>
<center>
<table border = "1">
<caption>Table & Image</caption>
<tr>
<th> Description</th>
<th> Image </th>
</tr>
<tr>
<td> Tulips</td>
<td> <img src = "Tulips.jpg" alt = "cant display" height=100 width=100></td> </tr>
<tr>
<td> Corn</td>
<td> <img src = "corn.jpg" alt = "cant display" height=100 width=100></td> </tr>
</table>
</center>
</body>
</html>
From the desk of Roopa R, S.G.T College, Bellary. 16
UNIT-I A BRIEF INTRODUCTION ABOUT THE INTERNET Web Designing BCA I Sem NEP
Table Sections
Tables naturally occur in two and sometimes three parts: header, body, and footer. (Not all tables have a natural footer.)
These three parts can be respectively denoted in XHTML with the thead, tbody, and tfoot elements.
The header includes the column labels, regardless of the number of levels in those labels. The body includes the data of
the table, including the row labels. The footer, when it appears, sometimes has the column labels repeated after the body.
In some tables, the footer contains totals for the columns of data above.
A table can have multiple body sections, in which case the browser may delimit them with horizontal lines that are thicker
than the rule lines within a body section.
FORMS IN HTML
The most common way for a user to communicate information from a Web browser to the server is through a form.
XHTML provides tags to generate the commonly used objects on a screen form. These objects are called controls
or widgets. There are controls for single-line and multiple-line text collection, checkboxes, radio buttons, and
menus, among others. All control tags are inline tags.
The <form> Tag
All of the controls of a form appear in the content of a <form> tag. A block tag, <form>, can have several different
attributes, only one of which, action, is required. The action attribute specifies the URL of the application on the
Web server that is to be called when the user clicks the Submit button. Our examples of form elements will not
have corresponding application programs, so the value of their action attributes will be the empty string ("").
The <input> Tag
Many of the commonly used controls are specified with the inline tag <input>, including those for text, passwords,
checkboxes, radio buttons, and the action buttons Reset, Submit, and plain.
❖ Text Box
✓ It is a type of input which takes the text.
✓ Any type of input can be created using <input>
✓ The type attribute indicates what type of input is needed for the text box, the value should be given as text.
✓ For any type of input, a name has to be provided which is done using name attribute.
✓ The size of the text can be controlled using size attribute.
✓ Every browser has a limit on the number of characters it can collect. If this limit is exceeded, the extra characters
are chopped off. To prevent this chopping, max length attribute can be used. When max length is used, users can
enter only those many characters that is given as a value to the attribute. <html>
<head>
Password Box
✓ If the contents of a text box should not be displayed when they are entered by the user, a password control can
be used.
✓ In this case, regardless of what characters are typed into the password control, only bullets or asterisks are
displayed by the browser.
<html>
<head>
<title>Password Box</title>
</head>
<body> <form action = " ">
<p> <label>Enter the email id: <input type = "text" name = "myname" size = "24" maxlength = "25" /> </label>
</p>
<p> <label>Enter the password: <input type = "password" name = "mypass" size = "20" maxlength = "20" /> </label>
</p>
</form>
</body>
</html>
Radio Button
✓ Radio buttons are special type of buttons which allows the user to select only individual option ✓ Radio buttons
are created using the input tag with the type attribute having the value radio.
✓ When radio buttons are created, values must be provided with the help of value attribute.
✓ All the radio buttons which are created would have same name. This is because the radio buttons are group
elements.
✓ If one of the radio buttons has to be selected as soon as the web page is loaded, checked attribute should be used.
The value also would be checked.
<html>
<head>
<title>Radio Button</title>
</head>
<body>
<h3>Who is your Favourite Player?</h3>
Check Box
✓ Check box is a type of input using which multiple options can be selected.
✓ Check box can also be created using the <input> tag with the type having the value “checkbox”.
✓ During the creation of check box, the value should be provided using the value attribute.
✓ All the checkbox which are created would have the same name because they are group elements.
✓ If one of the check box have to be selected as soon as the page is loaded, checked attribute should be used with
the value checked.
<html>
<head>
<title>Check Box</title>
</head>
<body>
<h3>What is your Educational Qualification?</h3>
<form action = " ">
<p> <label><input type="checkbox" name="edu" value="one"/>SSLC</label>
<label><input type="checkbox" name="act" value="two"/>PUC</label>
<label><input type="checkbox" name="act" value="three"/>Degree/Diploma</label>
<label><input type="checkbox" name="act" value="four"/>Post Graduation</label> <label><input
type="checkbox" name="act" value="four"/>Doctrate</label>
</p>
</form>
</body>
</html>
If you give <select name = "branches" size = “3”>, then you will get a scroll bar instead of drop down menu. It is as
shown in the output given below:
<html>
<head>
<title> text area </title>
</head>
<body>
<form action=" ">
<h3> Enter your comments</h3>
<p> <textarea name="feedback" rows="5" cols="100">
</textarea>
</p>
</form>
</body>
</html>
NOTE: A plain button has the type button. Plain buttons are used to choose an action.
Example of a Complete Form:
<html>
<head>
<title> CompleteForm</title>
</head>
<body>
<h1>Registration Form</h1>
<form action=" "> <p>
<label>Enter your email id: <input type = "text" name = "myname" size = "24" maxlength = "25" /> </label> </p>
<p> <label>Enter the password: <input type = "password" name = "mypass" size = "20" maxlength = "20" /> </label>
</p>
<p>Sex</p>
<p> <label><input type="radio" name="act" value="one"/>Male</label>
<label><input type="radio" name="act" value="two"/>Female</label>
</p>
<p>Which of the following Accounts do you have?</p>
<p> <label><input type="checkbox" name="act" value="one"/>Gmail</label>
<label><input type="checkbox" name="act" value="two"/>Facebook</label>
<label><input type="checkbox" name="act" value="three"/>Twitter</label>
<label><input type="checkbox" name="act" value="four"/>Google+</label> </p>
<p> Any Suggestions?</p>
<p> <textarea name="feedback" rows="5" cols="100"> </textarea> </p>
<p>Click on Submit if you want to register</p>
<p> <input type="SUBMIT" value="SUBMIT"/>
<input type="RESET" value="RESET"/> </p>
</form>
</body>
</html>
FRAMES
The browser window can be used to display more than one document at a time. The window can be divided into
rectangular areas, each of which is a frame. Each frame is capable of displaying its own document.
Framesets:
* The number of frames and their layout in the browser window are specified with the <frameset> tag.
* A frameset element takes the place of the body element in a document. A document has either a body or a frameset
but cannot have both.
* The <frameset> tag must have either a rows or a cols attribute. (or both) * To create horizontal frames, rows
attribute is used.
* To create vertical frames, cols attribute is used.
* The values for these attributes can be numbers, percentages and asterisks.
Create two frames vertically on the browser window: the first frame should occupy 40% and the next frame
should occupy 60%. In the first frame, display a document which consists of hyperlinks. When the
hyperlinks are clicked, Image should be displayed on the second frame.
Frames.html imgfile1.html
<html> <html>
<head> <head>
<title>Frames</title> <title>Image1</title>
</head> </head>
<frameset cols = "30%,70%"> <body>
<frame src = "frmtarget.html"/> <img src="shapes.png" alt="cannot display"/>
<frame name = "description"/> </body>
</frameset> </html>
</html>
frmtarget.html <h3><a href="imgfile2.html" target =
<html> "description">
<head> Computer</a> </h3>
<title>Frames Target</title> <h3><a href="imgfile3.html" target =
</head> "description">
<body> Tulips flower</a>
<h2>CLICK HERE</h2> </h3>
<h3><a href="imgfile1.html" target = "description"> </body>
Geometrical shapes</a> </h3> </html>