- World Institute Of Technology

Transcription

- World Institute Of Technology
CSE-208 F
Internet Fundamentals
Class Work: 50
.
NOTE: For setting up the question paper, question no 1 will be set up from all the four
sections which will be compulsory and of short answer type. Two questions will be set from
each of the four sections. The students have to attempt first common question, which is
compulsory, and one question from each of the four sections. Thus students will have to
attempt 5 questions out of 9 questions.
Section A: Electronic Mail and Internet:
Introduction, advantages and disadvantages, Userids, Pass words, e-mail addresses, message
components, message composition, mailer features, E-mail inner workings, E-mail management,
Mime types, Newsgroups, mailing lists, chat rooms. Introduction to networks and internet,
history, Working of Internet, Internet Congestion, internet culture, business culture on internet.
Collaborative computing & the internet. Modes of Connecting to Internet, Internet Service
Providers(ISPs), Internet address, standard address, domain name, DNS, IP.v6.Modems and time
continuum, communications software; internet tools.
Section B: World Wide Web :
Introduction, Miscellaneous Web Browser details, searching the www: Directories search
engines and meta search engines, search fundamentals, search strategies, working of the search
engines, Telnet and FTP. Introduction to Browser, Coast-to-coast surfing, hypertext markup
language, Web page installation, Web page setup, Basics of HTML & formatting and hyperlink
creation. Using FrontPage Express, Plug-ins.
Section C: Languages:
Basic and advanced HTML, java script language, Client and Server Side Programming in java
script. Forms and data in java script, XML basics. Introduction to Web Servers: PWS, IIS,
Apache; Microsoft Personal Web Server. Accessing & using these servers.
Section D: Privacy and security topics:
Introduction, Software Complexity, Encryption schemes, Secure Web document, Digital
Signatures, Firewalls.
Text Book:
Fundamentals of the Internet and the World Wide Web, Raymond Greenlaw and Ellen
Hepp – 2001, TMH
Internet & World Wide Programming, Deitel,Deitel & Nieto, 2000, Pearson Education
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Reference Books:
Complete idiots guide to java script,. Aron Weiss, QUE, 1997
Network firewalls, Kironjeet syan -New Rider Pub.
www.secinf.com
www.hackers.com
Alfred Glkossbrenner-Internet 101 Computing MGH, 1996
Section A: Electronic Mail and Internet
Email
Electronic mail (also known as email or e-mail) is one of the most commonly used services
on the Internet, allowing people to send messages to one or more recipients. Email was invented
by Ray Tomlinson in 1972.
It is a system used for creating, sending and storing textual data in digital form over a
network. Earlier, the e-mail system was based on Simple Mail Transfer Protocol (SMTP)
mechanism, a protocol used for sending e-mails from one server to another. Today's e-mail
technology uses the store-and-forward model. In this model, the user sends and receives
information on their own computer terminal. However, the computer is used only for connecting
to the e-mail architecture. The creation, transmission and storage of e-mail takes place, only
when the connection with this e-mail architecture is established.
E-mail is one of the many technological developments that have influenced our lives. It has
changed the medium of communication. So, it becomes necessary for us to have a look at the
benefits and harmful effects of this popular mailing tool.
General Description of Electronic Mail
Electronic mail, email, is a computer based method of sending messages from one computer
user to another. These messages usually consist of individual pieces of text which you can send
to another computer user even if the other user is not logged in (i.e. using the computer) at the
time you send your message. The message can then be read at a later time. This procedure is
analogous to sending and receiving a letter.
Originally, email messages were restricted to simple text, but now many systems can
handle more complicated formats, such as graphics and word processed documents.
When mail is received on a computer system, it is usually stored in an electronic mailbox for the
recipient to read later. Electronic mailboxes are usually special files on a computer which can be
accessed using various commands. Each user normally has their individual mailbox.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
It is straightforward to send electronic mail between users of different computer systems which are
connected to major networks. Most major academic and research institutions and companies
throughout the world can now be reached by electronic mail. In addition, a growing number of
individuals can be contacted in this way. In the UK, most academic and research institutions are linked
by a network called JANET (or SuperJANET). This is effectively part of the Internet, so email
can be exchanged with most national and international networks.
Email Facilities
All email systems have the ability to send, receive and discard mail. Most systems have
facilities for storing mail which is to be kept rather than discarded. It is important to discard mail
which does not need to be kept, as it uses storage space on disks. Mailboxes can soon accumulate
a large number of mail messages making it difficult to read and process new mail, in addition to
wasting disk space.
There is almost always a connection between the email system and the computer's standard
file system which allows mail to be read from files or written to files. This enables greater
flexibility in how the mail system is used. For example, a mail message may be prepared in a
normal file using a familiar text editor and then sent by the email system. Sections of other files
may be included in the mail message as well.
Most systems have a reply facility, although some of these do not always work as expected.
Care should be taken when using this facility in electronic mail, as replies do not always go back
to the sender.
Advantages of Email
The benefits of e-mail are huge in number.
Easy to use: E-mail frees us from the tedious task of managing data for daily use. It helps us
manage our contacts, send mails quickly, maintain our mail history, store the required
information, etc.
Speed: An e-mail is delivered instantly and anywhere across the globe. No other service matches
the e-mail in terms of speed.
Easy to prioritize: Because e-mails come with a subject line, it is easy to prioritize them and
ignore the unwanted ones.
Reliable and secure: Constant efforts are being taken to improve the security in electronic
mails. It makes e-mail one of the secured ways of communication.
Informal and conversational: The language used in e-mails is generally simple and thus, makes
the process of communication informal. Sending and receiving e-mails takes less time, so it can
be used as a tool for interaction.
Easier for reference: When a person needs to reply to a mail, he/she can use the provision of
attaching previous mails as references. It helps refresh the recipient's know-how on what he is
reading.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Automated e-mails: It is possible to send automated e-mails using special programs
like autoresponders. The autoresponders reply only to those messages with generalized, prewritten text messages.
Environment friendly: Postal mails use paper as a medium to send letters. Electronic mail
therefore, prevents a large number of trees from getting axed. It also saves the fuel needed for
transportation.
Use of graphics: Colorful greeting cards and interesting pictures can be sent through e-mails.
This adds value to the e-mail service.
Advertising tool: Nowadays, many individuals and companies are using the e-mail service to
advertise their products, services, etc.
Info at your fingertips: Storing data online means less large, space taking file cabinets, folders
and shelves. You can access information far quicker if you learn how to use email this way.
Leverage: Send the same message to any number of people. Adaptations are simple, too. If you
have a product or service to sell, email is an effective medium to get your message out.
Send reminders to yourself. Do you use more than one account? Email yourself messages from
work to home or vice versa.
Disadvantages of Email
The e-mail service, though beneficial in our day-to-day life, has got its own drawbacks that are
off late coming to the fore.
Viruses: These are computer programs which have the potential to harm a computer system.
These programs copy themselves and further infect the computer. The recipient needs to scan the
mails since; viruses are transmitted through them and have the potential to harm computer
systems.
Spam: E-mails when used to send unsolicited messages and unwanted advertisements create
nuisance and are termed as Spam. Checking and deleting these unwanted mails can unnecessarily
consume a lot of time. It has therefore, become necessary to block or filter unwanted e-mails by
means of spam filters. Spamming is practiced by sending hoax e-mails. E-mail spoofing is
another common practice, used for spamming. The act of spoofing involves deceiving the
recipient by altering e-mail headers or addresses from which the mail is sent.
Hacking: The act of breaking into computer security is termed as hacking. In this form of
security breach, e-mails are intercepted by hackers. An e-mail before being delivered to the
recipient, "bounces" between servers located in different parts of the world; hence, it can be
hacked by a professional hacker.
Misinterpretation: One has to be careful while posting content through an e-mail. If typed in a
hurry, the matter could be misinterpreted.
Lengthy mails: If the mail is too long and not properly presented, the reader may lose interest in
reading it.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Not suitable for business: Since the content posted via e-mails is considered informal, there is a
chance of business documents going unnoticed. Thus, urgent transactions and especially those
requiring signatures are not managed through e-mails.
Crowded inbox: Over a period of time, the e-mail inbox may get crowded with mails. It
becomes difficult for users to manage such a huge chunk of mails.
Need to check the inbox regularly: In order to stay updated, one has to check his e-mail
account regularly.
Lacks the personal touch: Some things are best left untyped. Email will never beat a hand
written card or letter when it comes to relationships.
Every new technology enters the social world with its share of benefits and drawbacks.
Different people interpret and utilize it in different ways. In order to make the most of the
available technology, users should try to understand both, the positive and negative sides of the
tool they use. No technology can be deemed totally perfect!
How email works (MTA, MDA, MUA)
Email, as simple as it is to use, relies on a more complicated set of operating procedures
than that of the Web. For most users, its operation is transparent, which means that it is not
necessary to understand how email works in order to be able to use it.
However, the short introduction below has been provided to help users understand its basic
principles, give them an idea of how to best configure their email clients and inform them about
the underlying mechanisms of spam.
Email is based around the use of electronic mailboxes. When an email is sent, the message
is routed from server to server, all the way to the recipient's email server. More precisely, the
message is sent to the mail server tasked with transporting emails (called the MTA, for Mail
Transport Agent) to the recipient's MTA. On the Internet, MTAs communicate with one another
using the protocol SMTP, and so are logically called SMTP servers (or sometimes outgoing
mail servers).
The recipient's MTA then delivers the email to the incoming mail server (called the MDA,
for Mail Delivery Agent), which stores the email as it waits for the user to accept it. There are
two main protocols used for retrieving email on an MDA:
POP3 (Post Office Protocol), the older of the two, which is used for retrieving email and, in
certain cases, leaving a copy of it on the server.
IMAP (Internet Message Access Protocol), which is used for coordinating the status of
emails (read, deleted, moved) across multiple email clients. With IMAP, a copy of every
message is saved on the server, so that this synchronization task can be completed.
For this reason, incoming mail servers are called POP servers or IMAP servers,
depending on which protocol is used.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
To use a real-world analogy, MTAs act as the post office (the sorting area and mail carrier,
which handle message transportation), while MDAs act as mailboxes, which store messages (as
much as their volume will allow) until the recipients check the box. This means that it is not
necessary for recipients to be connected in order for them to be sent email.
To keep everyone from checking other users' emails, MDA is protected by a user name
called a login and by a password.
Retrieving mail is done using a software program called an MUA (Mail User Agent). When
the MUA is a program installed on the user's system, it is called an email client (such as Mozilla
Thunderbird, Microsoft Outlook, Eudora Mail, or Lotus Notes). When it is a web interface used
for interacting with the incoming mail server, it is called webmail.
Using email
An email client, a software program for writing, checking and sending email, is generally
made up of a number of windows. The main windows of this software are:
• Incoming, In, Inbox: This represents the main mailbox for receiving email,
• Sent, Outbox, Out: These are copies of messages that you have sent.
• Deleted, Trash: The trash bin containing deleted emails. When emails are shown in the
trash, you can still retrieve them. To permanently delete them, you will need empty the trash
bin.
• Folders: Most clients can be used to file emails in folders, much like folders on a hard drive.
Email fields
Here are the meanings of the fields to be filled in when you send an email:
•
•
•
•
From: this is your email address; most of the time you will not have to fill in this field,
because it is generally set by the email client according to your preferences.
To: This field is used for the recipient's email address.
Subject: this is the title that your recipients will see when they want to read the email
Cc (carbon copy): this allows an email to be send to a large number of people by writing their
respective addresses separated by commas
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
•
Bcc (blind carbon copy): This is a Cc, except that the recipient does not see the list of people
in the Bcc field
Message: This is the body of your message
The Carbon Copy function sends a copy to people not directly involved with the message
but whom you wish to keep up to date with the message contents or show that you sent the email
to the recipient(s).
The Blind Carbon Copy function makes it possible to forward messages without any of the
recipients or even the hidden recipients seeing that the message is being forwarded to them. It is
generally recommended when sending an email to many people to forward it using Blind copy so
as to prevent one of the recipients from replying to everyone or assembling a list of addresses.
Other email functions are:
• Attached Files, Attachments: A file can be attached to an email by specifying its location on
the hard drive.
• Signature: If the email client allows it, you are often able to set a signature, meaning a few
lines of text which will be added to the end of the document.
Userid and Password
A computer system uses userids and passwords together to grant access to the system. You
need the correct combination of userid and password, to access your account.
Userid
The userid identifies you to the computer. Userids are typically some form of your name. (Your
last name, for example). A userid must be unique throughout the computer system. This allows
the computer to distinguish between you and some other person. One confusing issue is that
different systems refer to a userid (the thing that identifies you to the computer) with different
names. Some that you may run across are:
Login ID
Username
Userid
But, they all refer to that special name that identifies you to that particular computer system.
Your userid is also used for communication with other people through electronic mail.
Since the userid identifies you to the computer, it is natural for it to be used to identify you to
other computer systems. For example: The person Joe B. User could have this userid, "jbu3470".
The userid is made up of the person's initials and the digits of some personal identification
number.
Password
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
To prevent other people from using your account via your userid, you are required to have
a password. A password allows you and only you to access the computer system through your
userid. It basically proves to the computer system that you are who you say you are. So it should
be obvious that you DO NOT GIVE YOUR PASSWORD TO ANYONE!!!
User ID and Password Rules
Please review the User ID and Password guidelines below before selecting a User ID or selecting
or changing your Password.
User ID:
User IDs must be 7-14 characters
User IDs must contain at least one letter; numbers are allowed, but not required
User IDs cannot contain spaces
User IDs cannot contain your Social Security Number, Tax Identification Number, or Customer
Access Number
No special characters are allowed, such as: ! @ # $ % ^ &
Use of an underscore is allowed but not required: _
Do not use your Password as your User ID
Password:
Passwords must be 7-14 characters
Passwords must include at least one letter and one number
Passwords cannot contain spaces
Semicolons cannot be part of a Password
Passwords are case-sensitive
Do not use your User ID as your Password
If you forget your User ID or Password, you can retrieve them through the "User ID & Password
Help" link.
Note: You cannot change your User ID once it is established.
What to do with a message
There are many operations that can be performed on emails:
• New, Compose, Write: Write a new message
• Erase, Delete, Remove: Erase a message
• Store, Save, Backup, Drafts: Copy a message into a safer place
• Print: Print a message
• Reply: Send a reply message to the sender (sometimes including their own message in the
body of the document, with each line proceeded by the symbol ">" and "Re:" followed by
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
•
their chosen subject as the title, to show that it is a reply. The Reply All button makes it
possible to send a reply to the sender as well as everyone else who had been put as a recipient
or on copy.
Forward: Forwards the message to someone else, letting them know that the message comes
from you. The subject is generally preceded by Fwd: to indicate that it is a forwarded
message.
Redirect, Transmit: Forward a message to someone, letting them know where it originally
came from. The subject is generally preceded by Fwd: to indicate that it is a forwarded
message.
Email addresses
Electronic mail must be addressed properly, in much the same way as a normal letter needs
to be addressed, in order that it can reach its intended recipient. However, with electronic mail
the addressing has to be slightly different and must be more precise than a conventional mail
address.
Most email uses is addressed using internet addresses. These are supported by what is
known as the Domain Name Server (DNS). This is an internationally distributed naming scheme
and the components of each address are structured in a hierarchical manner. These start with the
mailname of the person, followed by various address components, ending with the "Top level"
domain (often a country code). In this respect, the addressing is in the same order as that of a
conventional letter.
Email addresses (both for senders and recipients) are two strings separated by the character
"@" (the "at sign"): user@domain
The right-hand part describes the domain name involved, and the left-hand part refers to the
user who belongs to that domain. One or more mail servers correspond to each domain.
An email address can be up to 255 characters long and can include the following characters:
•
Lowercase letters from a to z;
•
Digits
•
The characters ".","_" and "-" (full stop, underscore, and hyphen)
In practice, an email address often looks something like this:
[email protected]
For example
[email protected]
The mailname comes first, indicating who the email is for. The "@" sign separates the
mailname from the site. The next components indicate details of the system to which the email is
sent.
bham = Birmingham
ac = academic
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
uk = Great Britain
The final component ("top level" domain) is normally the ISO3166 standard two letter
country code. There are, however, two main types of exception. One is Great Britain (gb) which
uses "uk". The other exceptions are mainly some of American domains (eg edu, mil, gov). These
are at the same "level" in the naming scheme as countries.
Addresses of this form are also known as rfc822 addresses, because that is the name of the
Internet standard in which the addresses were originally described.
Partially qualified addresses
Some systems will allow the address to be specified in an incomplete form. For example,
[email protected]
could be expressed as
E.V.Nebor@bham
This is known as a partially qualified address. The use of these names is NOT
RECOMMENDED, as they are not universally recognized and are a cause of many errors and
much confusion. The full address should always be used.
Message Components
Header
The header of an e-mail address is where all the important addressing information is kept,
along with data about the message itself. The following table describes the elements that make
up the header of an e-mail.
To
The TO Field is where the email address of the messages recipient is entered.
Subject The subject is essentially a title, or a very short summary, of an e-mail. Ideally it
should contain some sort of reference to the emails content
CC
BCC
To Carbon Copy (CC) a message to someone is to send them a copy of the e-mail,
even though they are not the e-mail’s intended recipient. This is a common practice in
business communications, where many people in an organization often need to be
made aware of certain communications, even if they are not actively involved in the
conversation.
BCC stands for Blind Carbon Copy. Any people included in the BCC recipient list
of an e-mail receive a copy of the message, but their name is not included in the
message headers, and no one else who received the message knows that they were sent
a copy.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Body
The body of the message is, of course, the most important part. Everything you need to say
is entered here, and this is what the recipient will be reading.
Message Composition
Steps are:
• Launching your e-mail program is usually as simple as clicking on the e-mail icon on
your desktop. Once the program is open, write a message by clicking on the Compose
Mail, New Message or similar button.
•
•
•
•
•
In the new message window, type the e-mail addresses of the recipients in the To field,
or use the Address book to select one or more of the addresses.
In the CC field, enter the address of anyone you want to receive a copy of the message.
Type the e-mail address or choose it from the address book.
Type the subject of the message.
Now type your message.
Finally, click on the Send button.
Mailer Features
Most mailers provide common features which provide functionality for manipulating your
mail box contents, composing messages and saving messages to the disk. The features are:
Compose, File and Reply
A Compose button provides following features :
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
•
•
•
New – Compose a message from scratch.
Reply – Reply to the current message.
Forward – Pass the message on.
Vacation – You are going away and want automatic responses to be generated, and have
email saved.
A File button has the following functionality:
• Save – Save the current message into a file on disk.
• Insert – Include a file in the body of the message being composed.
• Exit – Leave the mailer.
• Open – Open a file from the disk.
• Attach – Append a file to a message.
A Reply button consists of following items:
• To sender.
• To all
• Forward
• Include
• Include bracketed.
E-mail Inner Working
If we split the mailing of a letter into three phases:
• In phase one, the steps needed to perform are compose, address, package, stamp and
deposit the letter in a suitable place for pick up.
• In phase two, a mail person, on a fixed schedule, retrieves the letter from its place of
deposit. Then the letter, if correctly addressed and with the proper postage, is routed to its
final destination mailbox.
• In phase three, the recipient check for mail, retrieves the letter from the mailbox, opens
the envelope, reads the mail, and perhaps files it away.
Similar phases need to be carried out in the electronic setting:
• Mailer, Mail Server, and Mailbox – Three mail components are necessary for the email
system to work.
• Mailers A mailer is also called a mail program, mail application, or mail client. A mailer
is the software that allows you to manage, read, and compose email.
• Mail Servers The mail server is a computer whose function is to receive, store and deliver
email.
• Mailboxes An electronic mailbox is a disk file specifically formatted to hold email
messages and information about them,.
There are several different ways in which users typically obtain their emails.
• Store and Forward Features
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
•
Central Mail Spool and IMAP
Bounce Feature
E-mail Management
Email is now the de facto standard for business communication across organizations at this
time. Recent research shows the extensive use of emails in business and its projected growth in
the future presents major information management challenges and risks for many organizations.
Just as any type of business information and record, email must be included as part of, and
adhered to the organizational standards addressing information and records:
• Capture
• Classification
• Storage
• Preservation
• Management
• Destruction
The vast quantities of emails held in inboxes, sent folders, and deleted item folders put the
organization at risk and adversely impact the performance of email servers in the organizations.
Email servers were never designed to act as repositories for such great quantities of emails and
move control of this information away from the organization. Without the management of
emails, it is difficult for organizations to meet their legal preservation requirements in the event
of litigation and government investigations, increasing the effort and cost in responding to ediscovery and disclosure.
Email management systems centrally capture emails created and received by employees.
Using a classification scheme to manage this content, retention periods and access controls can
be applied to manage emails. Metadata associated with the emails can be captured to allow this
information to be managed and retrieved. Email active archiving is one of the most common
applications for email management. At their most basic, these solutions either copy or remove
messages from the messaging application and some it at another location. Some approaches copy
all messages coming into and out of the messaging application in real time, while others will
physically remove the messages from the message store. In some of these solutions, the
messages are not archived, but attachments are and are replaced with either a stub or an outright
link within the message.
These email management systems, while attractive and effective, are merely part of an
overall solution. Organizations need to have records management programs, consisting of
organization-wide policies and procedures, staff and activities, in which these computer
applications can be successfully utilized.
Here are four simple email management rules to help you keep control of your inbox:
• Let your email program manage your email as much as possible.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Email management starts with setting up and using filters. If you're using an email program
such as Outlook, you can configure email rules to send your spam directly to the trash meaning that you don't waste your time reading and deleting it.
• Do not check your email on demand.
You don't need to see every piece of email the second it arrives. If you're using an email
program that announces the arrival of new email, turn off the program's announcement
features, such as making a sound or having a pop-up screen announce the arrival of email.
Checking email on demand can seriously interfere with whatever other tasks you're trying to
accomplish because most people will read email when they check it.
• Don't read and answer your email all day long.
You may get anywhere from a handful to hundreds of emails each day that need to be
answered, but they don't need to be answered immediately, interrupting whatever else you're
doing. Instead, set aside a particular time each day to review and answer your email.
Schedule the hour or whatever time it takes you to answer the volume of email you get, and
stick to that schedule as regularly as possible.
• Don't answer your email at your most productive time of day.
For me, (and for many others, I suspect), my most productive work time is the morning. If I
start my work day by answering my email, I lose the time that I'm at my most creative. If I'm
writing a piece, for instance, it takes me twice as long to compose it in the afternoon or
evening than it would in the morning, when I feel fresh and alert.
Answering email, on the other hand, isn't usually a task that calls for a great deal of
creativity. So by ignoring my email until the late afternoon, and answering it then, I get the dual
benefit of saving my most productive time for other more demanding tasks, and not continually
interrupting whatever other tasks I'm trying to accomplish.
MIME (Multipurpose Internet Mail Extensions)
MIME is a standard which was proposed by Bell Communications in 1991 in order to
expand upon the limited capabilities of email, and in particular to allow documents (such as
images, sound, and text) to be inserted in a message. It was originally defined by RFCs 1341 and
1342 in June 1992.
Using headers, MIME describes the type of message content and the encoding used.
MIME adds the following features to email service:
• Be able to send multiple attachments with a single message;
• Unlimited message length;
• Use of character sets other than ASCII code;
• Use of rich text (layouts, fonts, colours, etc)
• Binary attachments (executables, images, audio or video files, etc.), which may be divided if
needed.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
MIME uses special header directives to describe the format used in a message body, so that
the email client can interpret it correctly.
Common MIME Types are listed in the table below:
Type
Subtype
Description of Content Type
Application
Postscript
Printable postscript document
Tex
TEX document
troff
Printable troff document
Audio
Aiff
Apple sound
Au
Sun Microsystems sound
Midi
Musical Instrument Digital Interface
Realaudio
Progressive Networks sound
wav
Microsoft sound
Image
Gif
Graphics Interchange Format
Jpeg
Joint Photographic Experts Group
Png
Portable Network Graphics
Tiff
Tagged Image File Format
Model
Vrml
Virtual Reality Modeling Language
Text
Html
Hypertext Markup Language
Plain
Unformatted text
Sgml
Standard
Generalized
Markup
Language
Video
Avi
Microsoft Audio Video Interleaved
Mpeg
Moving Picture Experts Group
Quicktime
Apple QuickTime movie
Sgi-movie
Silicon Graphics movie
File Extensions
.eps, .ps
.tex
.t, .tr, .roff
.aif, .aiff,.aifc
.au, .snd
.midi, .mid
.ra, .ram
.wav
.gif
.jpeg,.jpg,.jpe
.png
.tiff, .tif
.wrl
.html, .htm
.txt
.sgml
.avi
.mpeg, .mpg
.qt, .mov
.movie
News Groups
A newsgroup is a continuous public discussion about a particular topic. You can join a
newsgroup at any time to become part of a huge conversation between hundreds or even
thousands of people
A newsgroup is a discussion about a particular subject consisting of notes written to a
central Internet site and redistributed through Usenet, a worldwide network of news discussion
groups. Usenet uses the Network News Transfer Protocol (NNTP).
Newsgroups are organized into subject hierarchies, with the first few letters of the
newsgroup name indicating the major subject category and sub-categories represented by a
subtopic name. Many subjects have multiple levels of subtopics. Newsgroups are divided into
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
categories. The categories help to determine what kind of group and what kind of postings you
will find there. Some major subject categories are:
• news,
• rec (recreation),
• soc (society),
• sci (science),
• comp (computers), and so forth (there are many more).
• Alt
• talk
Use of Newsgroups We can use newsgroups for various purposes, for example:
• Newsgroups are an excellent way to find out web sites to visit in your particular area of
interest or just pick up detailed information about area of interest.
• You can buy and sell stuff. People often advertise things for sale in some newsgroup.
Users can post to existing newsgroups, respond to previous posts, and create new
newsgroups.
Newcomers to newsgroups are requested to learn basic Usenet netiquette and to get
familiar with a newsgroup before posting to it. A frequently-asked questions is provided. The
rules can be found when you start to enter the Usenet through your browser or an online service.
You can subscribe to the postings on a particular newsgroup.
Some newsgroups are moderated by a designated person who decides which postings to
allow or to remove. Most newsgroups are unmoderated.
Mailing Lists
A mailing list is a collection of names and addresses used by an individual or an
organization to send material to multiple recipients. The term is often extended to include the
people subscribed to such a list, so the group of subscribers is referred to as "the mailing list", or
simply "the list".
Types of mailing lists
At least two types of mailing lists can be defined:
An announcement list is closer to the original sense, where a "mailing list" of people was
used as a recipient for newsletters, periodicals or advertising. Traditionally this was done through
the postal system.
With the rise of email, the electronic mailing list became popular. The second type allows
members to post their own items which are broadcast to all of the other mailing list members.
This second category is usually known as a discussion list.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
More definitions
When similar or identical material is sent out to all subscribers on a mailing list, it is often
referred to as a mailshot or a blast. A list for such use can also be referred to as a distribution list.
In legitimate (non-spam) mailing lists, individuals can subscribe or unsubscribe
themselves.
Mailing lists are often rented or sold. If rented, the renter agrees to use the mailing list for
only contractually agreed-upon times. The mailing list owner typically enforces this by "salting"
(known as "seeding" in direct mail) the mailing list with fake addresses and creating new salts
for each time the list is rented. Unscrupulous renters may attempt to bypass salts by renting
several lists and merging them to find the common, valid addresses.
Mailing list brokers exist to help organizations rent their lists. For some organizations, such
as specialized niche publications or charitable groups, their lists may be some of their most
valuable assets, and mailing list brokers help them maximize the value of their lists.
A mailing list is simply a list of e-mail addresses of people that are interested in the same
subject, are members of the same work group, or who are taking class together. When a member
of the list sends a note to the group's special address, the e-mail is broadcast to all of the
members of the list. The key advantage of a mailing list over things such as web-based
discussion is that as new message becomes available they are immediately delivered to the
participants’ mailboxes.
Chat Rooms
A chat room is a Web site, part of a Web site, or part of an online service such as America
Online, that provides a venue for communities of users with a common interest to communicate
in real time. Forums and discussion groups, in comparison, allow users to post messages but
don't have the capacity for interactive messaging. Most chat rooms don't require users to have
any special software; those that do, such as Internet Relay Chat (IRC) allow users to download it
from the Internet.
Chat room users register for the chat room of their choice, choose a user name and
password, and log into a particular room (most sites have multiple chat rooms). Inside the chat
room, generally there is a list of the people currently online, who also are alerted that another
person has entered the chat room. To chat, users type a message into a text box. The message is
almost immediately visible in the larger communal message area and other users respond. Users
can enter chat rooms and read messages without sending any, a practice known as lurking.
Because chat room messages are spontaneous and instantly visible, there is a potential for
abuse, which may or may not be intentional. Site hosts typically post a frequently asked
questions (FAQ) list to guide users to appropriate chat room behavior, such as introducing
yourself when you enter a room, making it clear when you are directing a question or response to
a specific user, and reporting disruptive users, for example. Disruptive users may verbally abuse
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
other chatters, monopolize the conversation, or even just disable it by repeatedly typing the same
word or phrase into the conversation, a practice (much frowned upon) known as scrolling.
Chat rooms can be found that focus on virtually any aspect of human endeavor or interest:
there are current communities based on classic movies, Irish ancestry, baton twirling, and
psychic readings, for example. Various sites, such as Yahoo, provide a directory of chat sites.
Others, such as MSN Web Communities, guide users through the steps required to create their
own chat room.
Introduction to Networks and Internet
When we communicate, we are sharing information. This sharing can be local or remote.
Between individuals, local communication usually occurs face to face, while remote
communication takes place over distance. The term “tele-communication”, which includes
telephony, telegraphy, and television, means communication at a distance. Data communications
are exchange of data between two devices via some transmission medium such as a copper wire.
A data communication system has five components:
• Message: The message is the information to be communicated. A popular form of
information includes text, numbers, pictures, audio and video.
• Sender: The sender is the device that sends the data message. It can be a computer,
workstation, telephone handset, video camera, and so on.
• Receiver: The receiver is the device that receives the message. It can be a computer,
workstation, telephone handset, television, and so on.
• Transmission Medium: The transmission medium is the physical path by which a
message travels from sender to receiver. Some examples of transmission media include
twisted-pair wire, coaxial cable, fibre-optic cable, and radio waves.
• Protocol: A protocol is a set of rules that governs data communications. It represents an
agreement between the communication devices. Without a protocol, two devices may be
connected but not communicating.
A computer network is a group of two or more computers connected to each electronically.
This means that the computers can "talk" to each other and that every computer in the network
can send information to the others. The computers in a network are autonomous in nature, that
means computers are independent or self governing. Usually, this means that the speed of the
connection is fast - faster than a normal connection to the Internet. A computer network allows
sharing of resources and information among interconnected devices.
Types of Computer Networks
Computer network design can range from simple to very complex. Networking can be as
simple as connecting two computers, or a computer and a printer, while more complex networks
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
can involve the connection of millions of computers and devices. Below is a brief outline of
different computer network types.
Local area network
A local area network (LAN) is a network that connects computers and devices in a limited
geographical area such as home, school, computer laboratory, office building, or closely
positioned group of buildings. Each computer or device on the network is a node. Current wired
LANs are most likely to be based on Ethernet technology, although new standards like ITUT also provide a way to create a wired LAN using existing home wires (coaxial cables, phone
lines and power lines).
The defining characteristics of LANs, in contrast to WANs (Wide Area Networks), include
their higher data transfer rates, smaller geographic range, and no need for leased
telecommunication lines. Current Ethernet or other IEEE 802.3 LAN technologies operate at
speeds up to 10 Gbit/s.
Personal area network
A personal area network (PAN) is a computer network used for communication among
computer and different information technological devices close to one person. Some examples of
devices that are used in a PAN are personal computers, printers, fax machines, telephones,
PDAs, scanners, and even video game consoles. A PAN may include wired and wireless devices.
The reach of a PAN typically extends to 10 meters. A wired PAN is usually constructed with
USB and Firewire connections while technologies such as Bluetooth and infrared
communication typically form a wireless PAN.
Home area network
A home area network (HAN) is a residential LAN which is used for communication
between digital devices typically deployed in the home, usually a small number of personal
computers and accessories, such as printers and mobile computing devices. An important
function is the sharing of Internet access, often a broadband service through a CATV or Digital
Subscriber Line (DSL) provider. It can also be referred to as an office area network (OAN).
Wide area network
A wide area network (WAN) is a computer network that covers a large geographic area
such as a city, country, or spans even intercontinental distances, using a communications channel
that combines many types of media such as telephone lines, cables, and air waves. A WAN often
uses transmission facilities provided by common carriers, such as telephone companies. WAN
technologies generally function at the lower three layers of the OSI reference model: the physical
layer, the data link layer, and the network layer.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Campus network
A campus network is a computer network made up of an interconnection of local area
networks (LAN's) within a limited geographical area. The networking equipments (switches,
routers) and transmission media (optical fiber, copper plant, etc.) are almost entirely owned (by
the campus tenant / owner: an enterprise, university, government etc.).
In the case of a university campus-based campus network, the network is likely to link a
variety of campus buildings including; academic departments, the university library and student
residence halls.
Metropolitan area network
A Metropolitan area network is a large computer network that usually spans a city or a
large campus.
Enterprise private network
An enterprise private network is a network build by an enterprise to interconnect various
company sites, e.g., production sites, head offices, remote offices, shops, in order to share
computer resources.
Virtual private network
A virtual private network (VPN) is a computer network in which some of the links between
nodes are carried by open connections or virtual circuits in some larger network (e.g., the
Internet) instead of by physical wires. The data link layer protocols of the virtual network are
said to be tunneled through the larger network when this is the case. One common application is
secure communications through the public Internet, but a VPN need not have explicit security
features, such as authentication or content encryption. VPNs, for example, can be used to
separate the traffic of different user communities over an underlying network with strong
security features.
VPN may have best-effort performance, or may have a defined service level agreement
(SLA) between the VPN customer and the VPN service provider. Generally, a VPN has a
topology more complex than point-to-point.
Internetwork
An internetwork is the connection of two or more private computer networks via a common
routing technology (OSI Layer 3) using routers. The Internet is an aggregation of many
internetworks; hence its name was shortened to Internet.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Backbone network
A Backbone network (BBN) or network backbone is part of a computer network
infrastructure that interconnects various pieces of network, providing a path for the exchange of
information between different LANs or sub networks. A backbone can tie together diverse
networks in the same building, in different buildings in a campus environment, or over wide
areas. Normally, the backbone's capacity is greater than the networks connected to it.
Global area network
A global area network (GAN) is a network used for supporting mobile communications
across an arbitrary number of wireless LANs, satellite coverage areas, etc. The key challenge in
mobile communications is handing off the user communications from one local coverage area to
the next.
Intranets and Extranets
An intranet is a set of networks, using the Internet Protocol and IP-based tools such as web
browsers and file transfer applications that are under the control of a single administrative entity.
Most commonly, an intranet is the internal network of an organization.
An extranet is a network that is limited in scope to a single organization or entity and also
has limited connections to the networks of one or more other trusted organizations or entities.
Technically, an extranet may also be categorized as a CAN, MAN, WAN, or other type of
network, although an extranet cannot consist of a single LAN; it must have at least one
connection with an external network.
Internet
The Internet is a global system of interconnected governmental, academic, corporate,
public, and private computer networks. It is based on the networking technologies of the Internet
Protocol Suite.
The Internet is a worldwide collection of computer networks, cooperating with each other
to exchange data using a common software standard. Through telephone wires and satellite links,
Internet users can share information in a variety of forms. The size, scope and design of the
Internet allow users to:
• connect easily through ordinary personal computers and local phone numbers;
• exchange electronic mail (E-mail) with friends and colleagues with accounts on the
Internet;
• post information for others to access, and update it frequently;
• access multimedia information that includes sound, photographic images and even video;
and
• Access diverse perspectives from around the world.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
An additional attribute of the Internet is that it lacks a central authority—in other words,
there is no "Internet, Inc." that controls the Internet. Beyond the various governing boards that
work to establish policies and standards, the Internet is bound by few rules and answers to no
single organization.
Many people think that the Internet is a recent innovation, when in fact the essence of it has
been around for over a quarter century. The Internet began as ARPAnet, a U.S. Department of
Defense project to create a nationwide computer network that would continue to function even if
a large portion of it were destroyed in a nuclear war or natural disaster.
During the next two decades, the network that evolved was used primarily by academic
institutions, scientists and the government for research and communications. The appeal of the
Internet to these bodies was obvious, as it allowed disparate institutions to connect to each
others' computing systems and databases, as well as share data via E-mail.
The nature of the Internet changed abruptly in 1992, when the U.S. government began
pulling out of network management, and commercial entities offered Internet access to the
general public for the first time. This change in focus marked the beginning of the Internet's
astonishing expansion. The Internet is also the communications backbone underlying the World
Wide Web (WWW).
Working of the Internet
•
Where to Begin? Internet Addresses
Because the Internet is a global network of computers each computer connected to the
Internet must have a unique address. Internet addresses are in the form nnn.nnn.nnn.nnn where
nnn must be a number from 0 - 255. This address is known as an IP address. (IP stands for
Internet Protocol)
The picture below illustrates two computers connected to the Internet; your computer with
IP address 1.2.3.4 and another computer with IP address 5.6.7.8.
If you connect to the Internet through an Internet Service Provider (ISP), you are usually
assigned a temporary IP address for the duration of your dial-in session. If you connect to the
Internet from a local area network (LAN) your computer might have a permanent IP address or it
might obtain a temporary one from a DHCP (Dynamic Host Configuration Protocol) server. In
any case, if you are connected to the Internet, your computer has a unique IP address.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
Protocol Stacks and Packets
So your computer is connected to the Internet and has a unique address. How does it 'talk'
to other computers connected to the Internet? An example should serve here: Let's say your IP
address is 1.2.3.4 and you want to send a message to the computer 5.6.7.8. The message you
want to send is "Hello computer 5.6.7.8!". Obviously, the message must be transmitted over
whatever kind of wire connects your computer to the Internet. Let's say you've dialed into your
ISP from home and the message must be transmitted over the phone line. Therefore the message
must be translated from alphabetic text into electronic signals, transmitted over the Internet, and
then translated back into alphabetic text. How is this accomplished? Through the use of
a protocol stack. Every computer needs one to communicate on the Internet and it is usually
built into the computer's operating system (i.e. Windows, UNIX, etc.). The protocol stack used
on the Internet is referred to as the TCP/IP protocol stack because of the two major
communication protocols used. The TCP/IP stack looks like this:
Protocol Layer
Comments
Application Protocols Layer
Protocols specific to applications such as WWW, e-mail, FTP,
etc.
Transmission Control Protocol
Layer
TCP directs packets to a specific application on a computer
using a port number.
Internet Protocol Layer
IP directs packets to a specific computer using an IP address.
Hardware Layer
Converts binary packet data to network signals and back.
(E.g. ethernet network card, modem for phone lines, etc.)
If we were to follow the path that the message "Hello computer 5.6.7.8!" took from our
computer to the computer with IP address 5.6.7.8, it would happen something like this:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
•
•
•
•
•
•
•
•
The message would start at the top of the protocol stack on your computer and work it's
way downward.
If the message to be sent is long, each stack layer that the message passes through may
break the message up into smaller chunks of data. This is because data sent over the
Internet (and most computer networks) are sent in manageable chunks. On the Internet,
these chunks of data are known as packets.
The packets would go through the Application Layer and continue to the TCP layer. Each
packet is assigned a port number. We need to know which program on the destination
computer needs to receive the message because it will be listening on a specific port.
After going through the TCP layer, the packets proceed to the IP layer. This is where
each packet receives its destination address, 5.6.7.8.
Now that our message packets have a port number and an IP address, they are ready to be
sent over the Internet. The hardware layer takes care of turning our packets containing the
alphabetic text of our message into electronic signals and transmitting them over the
phone line.
On the other end of the phone line your ISP has a direct connection to the Internet. The
ISPs router examines the destination address in each packet and determines where to send
it. Often, the packet's next stop is another router.
Eventually, the packets reach computer 5.6.7.8. Here, the packets start at the bottom of
the destination computer's TCP/IP stack and work upwards.
As the packets go upwards through the stack, all routing data that the sending computer's
stack added (such as IP address and port number) is stripped from the packets.
When the data reaches the top of the stack, the packets have been re-assembled into their
original form, "Hello computer 5.6.7.8!"
Internet Congestion
Internet congestion occurs when a large volume of data is being routed on low bandwidth
lines or across networks that have high latency and cannot handle large volumes. The result is
slowing down of packet movement, packet loss and drop in service quality.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Congestion Collapse is the situation in which the congestion becomes so great that
throughput drops to a low level and thus little useful communication occurs.
Various techniques have been developed in attempt to minimize congestion collapse in
communication networks. In addition to increasing capacity and data compression, they include
protocols for informing transmitting devices about the current levels of network congestion and
having them reroute or delay their transmissions according to congestion levels.
Congestion Control The processes that are used to reduce congestion in a network. This
includes making decisions such as: deciding when to accept new Traffic, when to delete packets
and when to adjust the routing policies used in the network.
Internet Culture
The Internet offers the hope of a more democratic society. By promoting a decentralized
form of social mobilization, it is said, the Internet can help us to renovate our institutions and
liberate ourselves from our authoritarian legacies. The Internet does indeed hold these
possibilities, but they are hardly inevitable. In order for the Internet to become a tool for social
progress, not a tool of oppression or another centralized broadcast medium or simply a waste of
money, concerned citizens must understand the different ways in which the Internet can become
embedded in larger social processes.
In thinking about culturally appropriate ways of using technologies like the Internet, the
best starting-point is with people -- coherent communities of people and the ways they think
together.
Let us consider an example. A photocopier company asked an anthropologist named Julian
Orr to study its repair technicians and recommend the best ways to use technology in supporting
their work. Orr took a broad view of the technicians' lives, learning some of their skills and
following them around. Each morning the technicians would come to work, pick up their
company vehicles, and drive to customers' premises where photocopiers needed fixing; each
evening they would return to the company, go to a bar together, and drink beer. Although the
company had provided the technicians with formal training, Orr discovered that they actually
acquired much of their expertise informally while drinking beer together. Having spent the day
contending with difficult repair problems, they would entertain one another with "war stories",
and these stories often helped them with future repairs. He suggested, therefore, that the
technicians be given radio equipment so that they could remain in contact all day, telling stories
and helping each other with their repair tasks.
As Orr's story suggests, people think together best when they have something important in
common. Networking technologies can often be used to create a space for "communities of
practice", like the photocopier technicians, to think together in their own ways. This is perhaps
the most common use of the Internet: discussion groups organized by people who wish to pool
their information and ideas about a topic of shared interest. At the same time, we should not
consider the Internet in isolation. Regardless of whether they are located in the same geographic
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
region or distributed around the world, a community's members will typically think together
using several media, such as the telephone, electronic mail, printed publications, and face-to-face
meetings, and the Internet is best conceived as simply one component of this larger ecology of
media.
Social networks also influence the adoption of new technologies: if the members of a
community already have social connections to one another than they are more likely to benefit
from technological connections. Every culture has its own distinctive practices for creating and
maintaining social networks, and a society will be healthier in political and economic terms
when these practices are functioning well.
Authoritarian societies will attempt to suppress the cultural practices of networking, and
democratic societies will promote them. Broad implementation of the Internet is one way to
promote social networking, and the existing practices of networking can offer clues to the most
effective ways of implementing the Internet.
Business Culture on Internet
Today’s business environment is influenced greatly by market, economical, societal and
technological factors creating a lot of competition. Also these factors are unpredictable that they
may change unexpectedly at any time. Such changes in the business world have been defined as
business pressure.
The various environmental business pressures on companies today can be grouped into
three categories:
• Market
• Societal
• Technological
Strength of Internet business over traditional business can be made more clear by the
comparison of both. Online purchasing and selling through e-business offers opportunities and
advantages to the companies of all sizes engaged in different portfolios. Some of these
advantages are:
• Sampling of products such as books, recorded lectures, and music cassettes is possible on
Web for business promotion.
• Business houses selling their goods through catalogues can reach additional global
customers at lower cost.
• For items subjected to frequent changes e.g. shares and bonds etc. . the changes in
rates/quotations can be known instantly.
• Customer’s knowledge can be enhanced on topics such as news about local event, market
research, industrial report, software etc., which can be distributed easily over the Internet.
• A closer relationship can be developed amongst business sellers whose customer base is
on the Internet.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
For wholesalers, distributors, retailers etc., it is convenient and efficient to buy from web
sites.
• High quality, specialized products can be easily sold on Internet by the retailers.
• Organizations can conduct interviews through Internet to select suitable candidates for
their requirements.
• Group discussions can be conducted for corporate offices, industrial houses, business
firms, universities, etc.
Disadvantages of Internet Business
1. Security
2. Staying connected
3. Availability
4. Access
5. Misunderstandings
Collaborative Computing and the Internet
Collaborative computing is a term describing a variety of activities where people interact
with one another using desktops, laptops, palmtops, and sophisticated digital cellular phones. As
computers are best at handling data and representing information, person-to-person
communication is enriched by an ability to share, modify, or collaboratively create data and
information.
We believe collaborative computing is the future of the Internet. The Internet will evolve
from its current role as a channel for information dissemination to a person-to-person
communication medium.
Some examples are listed below:
• Videoconferencing applications allow users to collaborate over local networks, private
WANs, or over the Internet.
• Internet collaboration tools provide virtual meetings, group discussions, chat rooms,
whiteboards, document exchange, workflow routing and many other features.
• Multicasting is an enabling technology for groupware and collaborative work on the
Internet that reduces bandwidth requirements.
• Instant messaging is like e-mail that happens in real time.
• Workflow management is about coordinating the flow of documents (invoices, reports,
legal documents etc.) within an organization from one person to another.
A good example of collaborative applications designed for Internet use are Microsoft’s
NetShow and NetMeeting.
Modes of Connecting to Internet
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
There are four ways of connecting a client computer to the Internet: a dial-up connection
using a telephone line or an Integrated Services Digital Network (ISDN), a Digital Subscriber
Line (DSL), a cable TV connection and a satellite connection.
Dial-up Connection/Telephone Line Internet Connectivity
A dial-up connection uses the analog telephone line for establishing a temporary
communication. Computer's digital signals must be converted to analog signals before they are
transmitted over standard telephone lines. This conversion is performed by a modem, a device
that modulates (changes into an analog signal) and demodulates (converts an analog signal into a
digital signal). Both the sending and receiving ends of a communication channel must have a
modem for data transmission to occur. Using a dial-up line to transmit data is similar to using the
telephone to make a call. The client computer modem dials the preprogrammed phone number
for a user's Internet Service Provider (ISP) and connects to one of the ISP's modems. After the
ISP has verified the user's account, a connection is established and data can be transmitted. When
either modem hangs up, the communication ends. The advantage of a dial-up line is that it costs
no more than a local telephone call. Computers at any two locations can establish a connection
using modems and a telephone network, to include wireless modems and cellular telephone
connections. The limitation of a connection using the ordinary telephone line is a low speed, 28
kbps. There are dedicated telephone lines that can transmit data at 56 kbps. Most 56 kbps
modems connect at a speed less than 46 kbps because of the limitations of analog phone lines
and telephone-company switches.
ISDN
ISDNs are special digital telephone lines that can be used to dial into the Internet at speeds
ranging from 64 to 128 kbps. These types of connections are not available everywhere telephone
companies have to install special ISDN digital switching equipment. ISDNs require use of a
special "digital modem" that sends and receives digital signals over ISDN lines. With an ISDN,
the telephone line is divided into three channels (BRI - Basic Rate Interface), two-64 kbps B
(bearer) channels that send data and one 16 kbps D (data) channel that sends routing information.
This type of access is commonly referred to as 2B+D. To use the ISDN access to the Internet, an
ISP has to offer the ISDN access. ISDN lines cost more than normal phone lines, so the
telephone rates are usually higher.
Cable TV Connection
Currently most households with cable TV have the option for cable modem Internet access.
The cable modem offers a high-speed link at low cost for unlimited, "always connected" access.
The connection speeds range from 128 kbps up to 10 mbps (megabits per second). A cable
modem is a device that connects to the existing TV cable feed and to an Ethernet network card in
the user's PC (also called an NIC - Network Interface Card). The cable network is designed to
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
support the highest speeds in the "downstream" direction, which is from the Internet to the client
computer. This downstream speed affects the performance of downloading Web pages and
software. The "upstream" bandwidth for data sent from a user's computer to the Internet is
typically less, in the range of 200 kbps to 2 mbps. The benefit of the cable modem for Internet
access is that, unlike DSL, its performance doesn't depend on distance from the central cable
office. However, with the cable TV network, the computer is put on a Local Area Network
(LAN) with other users in the neighborhood and like with any LAN, the performance degrades
as usage increases. A more disturbing issue is that of network security. One of the main purposes
of a LAN is to allow file sharing among the computers on the LAN. This LAN feature doesn't
work well with cable Internet access, as most users do not want neighbors accessing their files.
Turning the sharing option off can prevent file sharing. Also, installing the firewall hardware or
software may protect from hackers.
DSL (Digital Subscriber Line)
DSL service is a high-speed data service that works over POTS (Plain Old Telephone
Service) copper telephone lines and is typically offered by telephone companies without costly
installation of a higher-grade cable. DSL uses a different part of the frequency spectrum than
analog voice signals, so it can work in conjunction with a standard analog telephone service,
providing separate voice and data "channels" on the same line. ADSL (Asymmetric DSL) is the
type of DSL that provides different bandwidths in the upstream and downstream directions,
giving the user a much bigger "pipe" in the downstream direction. ADSL can support
downstream bandwidths of up to 8 mbps and upstream bandwidths of 1.5 mbps. For comparison,
a T-1 connection also provides 1.5 mbps. This scheme works well for the typical Internet user;
upstream communication is usually small (link requests) compared to downstream
communication (Web pages with graphics).
SDSL (Symmetric DSL) offers the same bandwidth capability in both directions. Besides
higher bandwidth, some of the advantages of ADSL access from telephone companies are that
there are no per-minute charges and the user gets an "always-on" connection for a monthly fee.
Most modern computers can be easily equipped to connect to a DSL service. This is
accomplished by connecting an ADSL modem to an Ethernet network card in the PC. The
downside of DSL includes strict distance limitation that DSL circuits can operate within. As the
connection's length increases, the signal quality decreases and the connection speed goes down.
DSL services that provide greater that 1.5 mbps require shorter distances to the central office
compared to a cable modem that can be located far away from the service provider.
The limit for ADSL service is 18,000 feet (5,460 meters), though for speed and quality of
service reasons many ADSL providers place a lower limit on the distances for the service. At the
extremes of the distance limits, ADSL customers may see speeds far below the promised
maximums, while customers near the central office have the potential for very high speeds.
Unlike cable modem technology, DSL provides a point-to-point connection to ISP. DSL
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
proponents claim this technology is both more secure and less prone to local traffic fluctuations
than its cable rival. By not sharing a LAN segment with other users, the systems are not as open
to intrusion or susceptible to performance degradations related to local traffic.
Satellite Connection
Getting the Internet feed from a satellite is really not all that different from getting TV
signals from one. In both cases data is being sent from the satellite to a user's equipment and then
translated and decoded. One major limitation of satellite technology is that it can only send data
from the satellite to a user's receiver—not the other way. To get around this problem, a separate
ISP connection is needed to send data to the Internet, typically over an analog modem. This
connection works in conjunction with the satellite feed. As information is requested via the
modem line, data are sent back via the satellite. Since most Internet users need high bandwidth
from the Web, downstream (typically Web pages and file downloads), and less bandwidth going
to the Web, upstream (typically link requests), this scenario of sending upstream data over a
standard modem line and downstream data over the high-bandwidth satellite feed has been
effective. The newest satellite technology allows for two-way communications and higher
upstream bandwidths. A satellite return channel can be added for traffic bound for the Internet.
The upload speeds through this satellite return channel may peak at 128 kbps. Download speeds
with this system are up to 400 kbps. Satellite technology has one strong advantage over cable
modems and DSL: accessibility. For many it is today's only high-speed option. It can reach
areas that are otherwise difficult to establish contact with. The infrastructure exists to provide
400 kbps downstream bandwidth to almost anyone with a 21" satellite dish. It is eight times
faster than fastest analog telephone modems and three times faster than ISDN. However, it is not
as fast as cable modems or DSL services, which both can provide more than megabits of
bandwidth. Also, cable and DSL access methods are cheaper. Equipment required for satellite
connection includes installation of a mini-dish satellite receiver and a satellite modem. Like
cable modem systems, satellite provides a "shared bandwidth" pipe. This means that download
performance may vary depending upon other users of the satellite transponder. Another potential
problem can be associated with severe weather. In severe snowstorms and heavy rain, users may
experience signal fade.
The general rule about the Internet connection is the faster, the better. The bandwidth and
transfer rate determine how quickly pictures, sounds, animation and video clips will be
downloaded. Since multimedia and interactivity make the Internet such an exciting tool for
information sharing, the speed is the key. Dial-up access provides an easy and inexpensive way
for users to connect to the Internet, however, it is a slow-speed technology and most users are no
longer satisfied with dial-up or ISDN connections. Fortunately, the broadband access, we once
dreamed of, is now possible with TV cable, DSL and satellite links.
Internet Service Provider (ISPs)
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
An ISP, or Internet Service Provider, is a company that offers internet access to individuals
and businesses for a monthly or yearly fees. In addition to internet connection, ISPs may also
provide related services like web site hosting and development, email hosting, domain name
registration etc.
Different ISPs, and sometimes even the same one, offer different types of internet
connections - dialup, cable and DSL broadband. Hardware such as dialup modem or a wireless
modem and router are usually provided by the company. When you register with an ISP for its
services, an account is created and you are provided with the login details –username and
password. You connect to the internet via your account and this way the company keeps a watch
on your online activities. ISPs can be both regional, confined to a geographic area, or national,
servicing the entire country and they are connected with each other through Network Access
Points (NAPs). ISPs are also referred to as Internet Access Providers.
Types of internet access
Most ISPs offer several types of internet access which essentially differ in connection
speeds – the time taken for download and upload. Many also offer different plans or “packages”
that vary in the download limit, number of email accounts on offer etc.
Dialup internet access is probably the slowest connection and requires you to connect to the
internet via your phone line by dialing a number specified by the ISP. This means, dialup
connections are not “always on”, unless you want to raise a huge phone bill, you would sever the
connection when you finish work online.
Cable internet access can be obtained from the local cable TV operator. However, ask them for
a demo first or check with your neighbourers on the quality of service.
Internet access via DSL broadband is indeed very fast and ISPs can offer different download
speeds – quicker the speed, higher will be the price. A wireless internet connection gives you
freedom and flexibility – you need not be confined to one place (the work table, for instance) and
can access the internet from any spot (even the bathroom) as long as your computer can catch the
wireless signal. However, ensure that the provider secures the wireless connection with a
password.
In many countries, especially those in which internet is still a kind of luxury, the ISPs may
put a limit on the amount of data exchanged over a connection. For example, one may be
allowed only a few GB (gigabytes) of download and upload each month. This is usually
sufficient for routine users but if you plan to download movies and music or other large files, you
have to keep a check on the amount of the data transfer.
How to choose an ISP?
• Monthly or yearly charge: Yes, we all need to keep a close watch on our wallets but this
does not mean you pick a lousy ISP just because it’s cheap. The price would also vary
across different plans – ensure you get the best deal.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
Type of internet access: A dialup connection would be more than enough if you plan to
access the internet for only a few hours each week. Want to download movies, music
etc.? Get a broadband connection.
• Regional or national ISP: Are you a frequent traveller? If so, talk to a national ISP and
see if they have a plan that lets you use the same connection (via a USB modem) from
different places.
• Extra services from the ISP.
IP address (Internet Protocol address)
Number that uniquely identifies each computer on the Internet. A computer's IP address
may be permanently assigned or supplied each time that it connects to the Internet by an Internet
service provider. In order to accommodate the extraordinary growth in the number of devices
connected to the Internet, a 32-bit protocol standard, known as IPv4, began to be replaced by a
128-bit protocol, IPv6, in 2000.
Another Definition of IP address
(Internet Protocol address) The address of a device attached to an IP network (TCP/IP
network). Every client, server and network device is assigned an IP address, and every IP packet
traversing an IP network contains a source IP address and a destination IP address.
Every IP address that is exposed to the public Internet is unique. In contrast, IP addresses
within a local network use the same private addresses; thus, a user's computer in company A can
have the same address as a user in company B and thousands of other companies. However,
private IP addresses are not reachable from the outside world.
Logical Vs. Physical
An IP address is a logical address that is assigned by software residing in a server or router.
In order to locate a device in the network, the logical IP address is converted to a physical
address by a function within the TCP/IP protocol software. The physical address is actually built
into the hardware.
Static and Dynamic IP
Network infrastructure devices such as servers, routers and firewalls are typically assigned
permanent "static" IP addresses. The client machines can also be assigned static IPs by a network
administrator, but most often are automatically assigned temporary "dynamic" IP addresses via
software that uses the "dynamic host configuration protocol" (DHCP). Cable and DSL modems
typically use dynamic IP with a new IP address assigned to the modem each time it is rebooted.
The Dotted Decimal Address: x.x.x.x
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
IP addresses are written in "dotted decimal" notation, which is four sets of numbers
separated by decimal points; for example, 204.171.64.2. Instead of the domain name of a Web
site, the actual IP address can be entered into the browser. However, the Domain Name System
(DNS) exists so users can enter computerlanguage.com instead of an IP address, and the domain
(the URL) computerlanguage.com is converted to the numeric IP address.
Although the next version of the IP protocol offers essentially an unlimited number of
unique IP addresses (IPv6), the traditional IP addressing system (IPv4) uses a smaller 32-bit
number that is split between the network and host (client, server, etc.). The host part can be
further divided into sub-networks.
Class A, B and C
Based on the split of the 32 bits, an IP address is either Class A, B or C, the most common
of which is Class C. More than two million Class C addresses are assigned, quite often in large
blocks to network access providers for use by their customers. The fewest are Class A networks,
which are reserved for government agencies and huge companies.
Domain Name System (DNS)
The World Wide Web that we know today would have not existed, if it was not for the
Domain Name System. Every day when you go online and open a website, the Domain Name
System is the backend, which helps you see the website you want.
What does actually stand behind that almighty 3-letter abbreviation - DNS? DNS refers to
Domain Name System and represents a powerful Internet technology for converting domain
names to IP addresses. Its special mission is to be a mediator between the IP addresses, the
system-side names of the websites and their respective domains, and their user-side alphanumeric titles. Another important function of the DNS is to control the delivery of email
messages
Behind every site, there is an IP address. But, while it's easy to remember the name of a
website, it's quite hard to remember the exact IP address. For example, everybody knows about
Google.com, but if you had to remember "74.125.45.100", things would have been much harder.
How does DNS work?
A DNS program works like this - every time a domain name is typed in a browser it is
automatically passed on to a DNS server, which translates the name into its corresponding IP
address (e.g. the domain name NTC Hosting.com is translated to 66.40.65.49). Thanks to the
DNS, we do not need to bother to remember complicated numeric combinations to reach a
certain website - we can use its meaningful and much easier to remember domain name instead.
Hierarchy of domain names
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
IPv6 (Internet Protocol Version 6)
Internet Protocol Version 6 (IPv6) is a network layer protocol that enables data
communications over a packet switched network. Packet switching involves the sending and
receiving of data in packets between two nodes in a network. The working standard for the IPv6
protocol was published by the Internet Engineering Task Force (IETF) in 1998. The IETF
specification for IPv6 is RFC 2460. IPv6 was intended to replace the widely used Internet
Protocol Version 4 (IPv4) that is considered the backbone of the modern Internet. IPv6 is often
referred to as the "next generation Internet" because of it's expanded capabilities.
IPv6 and IPv4 share a similar architecture. The majority of transport layer protocols that
function with IPv4 will also function with the IPv6 protocol. Most application layer protocols are
expected to be interoperable with IPv6 as well, with the notable exception of File Transfer
Protocol (FTP). FTP uses embedded network layer addresses to facilitate data transmission. An
IPv6 address consists of eight groups of four hexadecimal digits. If a group consists of four
zeros, the notation can be shortened using a colon to replace the zeros.
A main advantage of IPv6 is increased address space. The 128-bit length of IPv6
addresses is a significant gain over the 32-bit length of IPv4 addresses, allowing for an almost
limitless number of unique IP addresses. The size of the IPv6 address space makes it less
vulnerable to malicious activities such as IP scanning. IPv6 packets can support a larger payload
than IPv4 packets resulting in increased throughput and transport efficiency.
A key enhancement over IPv4 is native support for mobile devices. IPv6 supports the
Mobile IPv6 (MIPv6) protocol which enables mobile devices to switch between networks and
receive a roaming notification regardless of physical location. Auto-configuration is another IPv6
enhancement that is considered a great benefit to network administrators. IPv6 devices can
independently auto-configure themselves when connected with other IPv6 devices.
Configuration tasks that can be carried out automatically include IP address assignment and
device numbering. An IPv6 router has the ability to determine its own IPv6 address using data
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
link layer addressing parameters. The IPv6 protocol improves upon IPv4 with increased
authentication and privacy measures. IPSec security is embedded into the IPv6 specification to
manage encryption and authentication between hosts. This built in security framework enables
secure data traffic between hosts that is independent of any applications on either host. In this
way, IPv6 provides an efficient end to end security framework for data transfer at the host or the
network level.
Modems
A modem is a Modulator/Demodulator. It connects a terminal/computer to the Voice
channel (dial-up line). A modem can establish two types of connections:
Digital connection The connection between the modem and the terminal/computer is a digital
connection.
Analog connection The connection between the modem and the phone line is an analog
connection.
Types of Modem
• Internal Modems are a plug-in circuit board that sits inside the computer. It incorporates
the serial port on-board. They are less expensive than external modems because they do
not require a case, power supply and serial cable
• External Modems sit next to the computer and connect to the serial port using a cable
Communication Software
Communication software is used to provide remote access to systems and exchange files
and messages in text, audio and/or video formats between different computers or user IDs. This
includes terminal emulators, file transfer programs, chat and instant messaging programs.
Internet Tools
The internet communication takes place in following three ways and communication tools
are selected on the basis as follows:
• One-to-One Communication This type of communication is very common on Internet
and tools are:
• Email
• Chat type systems
• Large and Small Group Communication tools are:
• Social Networks
• Blogging
• Instant Messaging
• Chat
• Usenet
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
• Mail-based discussion list
Mass Communication tools are:
• Net Video
• Net Audio
• Mass Media Outlets
Section B: World Wide Web
Introduction to World Wide Web
The World Wide Web, abbreviated as WWW and commonly known as the Web, is
a system of interlinked hypertext documents accessed via the Internet. With a web browser, one
can view web pages that may contain text, images, videos, and other multimedia and navigate
between them via hyperlinks.
To use the Web, in addition to an Internet connection, a user needs a special piece of
software called a Web Browser (such as Internet Explorer). The browser acts as the graphical
interface between the user and the Internet – it sends the necessary command to request data
from other computers and then format them for the user’s screen. Documents that are formatted
using hypertext markup language (HTML) contain tag lines that inform the browser how to
format them.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
The Web is based on:
• HTML
• HTTP (Hyper Text Transfer Protocol)
• CGI (Common Gateway Interface)
Web Browser
A "browser" is a tool which lets Internet users visit their favourite websites. It is a kind of
software with a graphical interface which includes navigation buttons, an address bar, and a
status bar (generally below the window). Most of its surface is used to display Web pages.
Some common Features of web browsers are listed below:
Personal Preferences: Most browsers have a number of options that you can set. These
are:
1. Cookies you can ask to be notified before cookie is written and you can then decide
whether or not to allow the cookie to be written.
2. Disk Cache you can set the size of your cache
3. Fonts you can select a font specification and also set a default font size.
4. Helper applications
5. Home page location
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
6. Images
7. JavaScript and Java
8. Messages
• Bookmarks: A convenient feature of browsers allows you to save the URL of any Web
page you display.
• Plug-ins: they extend the power of the browser.
Searching the World Wide Web
Searching the WWW can be both beneficial and frustrating. This is where search engines
and web directories come in. Search engines, such as Google or Yahoo, are large databases of
information that store and retrieve relevant website results based on keywords. Web directories,
such as the Open Directory Project, are attempts to organize the best of the existing websites into
categories and subcategories. No search engine or web directory will have the same sites listed in
the same order, and none will have all of the possible sites on the Internet listed. Furthermore,
the ranking of a website within a search engine (i.e. how high up on the results list it appears) has
as much to do with politics as it does with quality information.
Recently, search engines such as Google and Yahoo have also been providing "sponsored
links"; links that appear on the first few pages of the search results and that are paid for by
advertisers. This means that you may end up clicking on something that is not relevant to your
search, but instead actually advertising. The image presented here gives you an example of this
on Google.
Kinds of Search Engines and Directories
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Web directories
Web directories (also known as indexes, web indexes or catalogues) are broken down into
categories and sub-categories and are good for broad searches of established sites. For example,
if you are looking for information on the environment but not sure how to phrase a potential
topic on holes in the ozone, you could try browsing through the Open Directory Project's
categories. In the Open Directory Project's "Science" category, there is a subcategory of
"Environment" that has over twenty subcategories listed. One of those subcategories is "Global
Change" which includes the "Ozone Layer" category. The "Ozone Layer" category has over
twenty-five references, including a FAQ site. Those references can help you determine the key
terms to use for a more focused search.
Search engines
Search engines ask for keywords or phrases and then search the Web for results. Some
search engines look only through page titles and headers. Others look through documents, such
as Google, which can search PDFs. Many search engines now include some directory categories
as well (such as Yahoo).
Metasearch engines
These (such as Dogpile, Mamma, and Metacrawler) search other search engines and often
search smaller, less well known search engines and specialized sites. These search engines are
good for doing large, sweeping searches of what information is out there.
A few negatives are associated with metasearch engines. First, most metasearch engines
will only let you search basic terms, so no Boolean operators or advanced search options.
Second, many metasearch engines pull from pay-per-click advertisers, so the results you get may
primary be paid advertising and not the most valid results on the web
Searching with a Search Engine
A search engine is a device that sends out inquiries to sites on the web and catalogs any
web site it encounters, without evaluating it. Methods of inquiry differ from search engine to
search engine, so the results reported by each one will also differ. Search engines maintain an
incredibly large number of sites in their archives, so you must limit your search terms in order to
avoid becoming overwhelmed by an unmanageable number of responses.
Search engines are good for finding sources for well-defined topics. Typing in a general
term such as "education" or "Shakespeare" will bring back far too many results, but by
narrowing your topic, you can get the kind (and amount) of information that you need.
Adjust your search based upon the number of responses you receive (if you get too few
responses submit a more general search; if you get too many, add more modifiers).
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Learn how the search engine works
Read the instructions and FAQs located on the search engine to learn how that particular
site works. Each search engine is slightly different, and a few minutes learning how to use the
site properly will save you large amounts of time and prevent useless searching.
Each search engine has different advantages. Google is one of the largest search engines,
followed closely by MSN and Yahoo. This means that these three search engines will search a
larger portion of the Internet than other search engines. Lycos allows you to search by region,
language, and date. Altavista has searches for images, audio, video, and news. Ask Jeeves allows
you to phrase your search terms in the form of a question. It is wise to search through multiple
search engines to find the most available information.
Search Fundamentals
The Internet contains a vast collection of information, which is spread out in every part of
the world on remote web servers. The problem in locating the correct information on the Internet
led to the creation of search technology, known as Internet Search Engine. A search engine can
provide links to relevant information based on your requirement or query. In order to understand
the terminology and techniques to position our web site pages for higher ranking in search
engines, the knowledge of the basic functioning of a search engine is essential.
Functions of Internet Search Engines
Each search engine dies the same functions of collecting, organizing, indexing and serving
results in its own unique ways, thus employing various algorithms and techniques. In short, the
functions of a search engine can be categorized into the following:
1. Crawling and Spidering the Web: The Crawler (also known as a web robot or a web
spider) is a software program that can download web content and follow hyperlinks
within these web contents to download the linked contents.
2. Building the Index: Search engines must store the information in a way that makes it
useful.
3. Storing the Web Site Contents
4. Search Algorithms and Results
Search Strategies
Search engines are good for finding sources for well-defined topics. Typing in a general
term such as "education" or "Shakespeare" will bring back far too many results, but by
narrowing your topic, you can get the kind (and amount) of information that you need.
Example:
• Go to Google (a search engine)
• Type in a general term ("education")
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
•
•
Add modifiers to further define and narrow your topic ("rural education Indiana")
Be as specific as you can ("rural education Indiana elementary school")
Submit your search.
Learn how the search engine works (Working of Search Engines)
Read the instructions and FAQs located on the search engine to learn how that particular
site works. Each search engine is slightly different, and a few minutes learning how to use the
site properly will save you large amounts of time and prevent useless searching.
Each search engine has different advantages. Google is one of the largest search engines,
followed closely by MSN and Yahoo. This means that these three search engines will search a
larger portion of the Internet than other search engines. Lycos allows you to search by region,
language, and date. Altavista has searches for images, audio, video, and news. Ask Jeeves allows
you to phrase your search terms in the form of a question. It is wise to search through multiple
search engines to find the most available information.
Select your terms carefully
Using inexact terms or terms that are too general will cause you problems. If your terms are
too broad or general, the search engine may not process them. Search engines are programmed
with various lists of words the designers determined to be so general that a search would turn up
hundreds of thousands of references. Check the search engine to see if it has a list of such stop
words. One stop word, for example, is "computers." Some search engines allow you to search
stop words with a specific code (for Google, entering a "+" before the word allows you to search
for it).
If your early searches turn up too many references, try searching some relevant ones to find
more specific or exact terms. You can start combining these specific terms with NOT when you
see which terms come up in references that are not relevant to your topic. In other words, keep
refining your search as you learn more about the terms.
You can also try to make your terms more precise by checking the online catalog of a
library. Most search engines now have "Advanced Search" features. These features allow you to
use Boolean operators (below) as well as specify other details like date, language, or file type.
Know Boolean operators
Most search engines allow you to combine terms with words (referred to as Boolean
operators) such as "and," "or," or "not." Knowing how to use these terms is very important for a
successful search. Most search engines will allow you to apply the Boolean operators in an
"advanced search" option.
AND
AND is the most useful and most important term. It tells the search engine to find your first
word AND your second word or term. AND can, however, cause problems, especially when you
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
use it with phrases or two terms that are each broad in themselves or likely to appear together in
other contexts.
For example, if you'd like information about the basketball team Chicago Bulls and type in
"Chicago AND Bulls," you will get references to Chicago and to bulls. Since Chicago is the
center of a large meat packing industry, many of the references will be about this since it is likely
that "Chicago" and "bull" will appear in many of the references relating to the meat-packing
industry.
OR
Use OR when a key term may appear in two different ways. For example, if you want
information on sudden infant death syndrome, try "sudden infant death syndrome OR SIDS." OR
is not always a helpful term because you may find too many combinations with OR. For
example, if you want information on the American economy and you type in "American OR
economy," you will get thousands of references to documents containing the word "American"
and thousands of unrelated ones with the word "economy."
NEAR
NEAR is a term that can only be used on some search engines, and it can be very useful. It
tells the search engine to find documents with both words but only when they appear near each
other, usually within a few words.
For example, suppose you were looking for information on mobile homes, almost every
site has a notice to "click here to return to the home page." Since "home" appears on so many
sites, the search engine will report references to sites with the word "mobile" and "click here to
return to the home page" since both terms appear on the page. Using NEAR would eliminate that
problem. At the time of the last handout update, Altavista is the only major search engine to
allow "NEAR" searches.
NOT
NOT tells the search engine to find a reference that contains one term but not the other.
This is useful when a term refers to multiple concepts. For example, if you are working on an
informative paper on eagles, you may encounter a host of websites that discuss the football team
the Philadelphia Eagles, instead. To omit the football team from your search results, you could
search for "eagles NOT Philadelphia."
Other Strategies for Web Searching
Looking for information about job opportunities? Look at some of the sites listing job
vacancies. Try university websites that sometimes list jobs through their placement offices, or try
professional organizations which also sometimes list jobs in that field. Or look through the
websites of various large companies because they usually have a section on job opportunities in
their company.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Looking for information likely to be discussed on newsgroups or chat rooms? Look through
the lists of newsgroups or use a search engine.
Looking for information about a current topic? Check the newspaper and current
newsmagazine sites. Most have a search engine for articles in their publications.
Looking for data that might have been collected on a government site? Start with sites such
as the Library of Congress or The White House.
Telnet
Telnet is a network protocol used on the Internet or local area networks to provide a
bidirectional
interactive
text-oriented
communications
facility
using
a
virtual terminal connection. User data is interspersed in-band with Telnet control information in
an 8-bit byte oriented data connection over the Transmission Control Protocol (TCP).
Telnet was developed in 1969 beginning with RFC 15, extended in RFC 854, and
standardized as Internet Engineering Task Force (IETF) Internet Standard STD 8, one of the first
Internet standards.
Historically, Telnet provided access to a command-line interface on a remote host. Most
network equipment and operating systems with a TCP/IP stack support a Telnet service for
remote configuration (including systems based on Windows NT). Because of security issues with
Telnet, its use for this purpose has waned in favor of SSH.
The term telnet may also refer to the software that implements the client part of the
protocol. Telnet client applications are available for virtually all computer platforms. Telnet is
also used as a verb. To telnet means to establish a connection with the Telnet protocol, either
with command line client or with a programmatic interface. For example, a common directive
might be: "To change your password, telnet to the server, login and run the passwd command."
Most often, a user will be telnetting to a Unix-like server system or a network device (such as a
router) and obtain a login prompt to a command line text interface or a character-based fullscreen manager.
Telnet is a client-server protocol, based on a reliable connection-oriented transport.
Typically this protocol is used to establish a connection to Transmission Control
Protocol (TCP) port number 23, where a Telnet server application (telnetd) is listening. Telnet,
however, predates TCP/IP and was originally run over Network Control Program (NCP)
protocols.
Because of negotiable options protocol architecture, many extensions were made for it,
some of which have been adopted as Internet standards, IETF documents STD 27 through STD
32. Some extensions have been widely implemented and others are proposed standards on the
IETF standards track.
Experts in computer security, such as SANS Institute, recommend that the use of Telnet for
remote logins should be discontinued under all normal circumstances, for the following reasons:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
•
•
Telnet, by default, does not encrypt any data sent over the connection (including passwords),
and so it is often practical to eavesdrop on the communications and use the password later
for malicious purposes; anybody who has access to a router, switch, hub or gateway located
on the network between the two hosts where Telnet is being used can intercept the packets
passing by and obtain login, password and whatever else is typed with a packet analyzer.
Most implementations of Telnet have no authentication that would ensure communication is
carried out between the two desired hosts and not intercepted in the middle.
Commonly used Telnet daemons have several vulnerabilities discovered over the years.
These security-related shortcomings have seen the usage of the Telnet protocol drop
rapidly, especially on the public Internet, in favor of the Secure Shell (SSH) protocol. SSH
provides much of the functionality of telnet, with the addition of strong encryption to prevent
sensitive data such as passwords from being intercepted, and public key authentication, to ensure
that the remote computer is actually who it claims to be. As has happened with other early
Internet protocols, extensions to the Telnet protocol provide Transport Layer Security (TLS)
security and Simple Authentication and Security Layer (SASL) authentication that address the
above issues. However, most Telnet implementations do not support these extensions; and there
has been relatively little interest in implementing these as SSH is adequate for most purposes.
FTP (File Transfer Protocol)
File Transfer Protocol (FTP) is a standard network protocol used to transfer files from one
host to another host over a TCP-based network, such as the Internet. FTP is built on a clientserver architecture and uses separate control and data connections between the client and
server. FTP users may authenticate themselves using a clear-text sign-in protocol but can connect
anonymously if the server is configured to allow it.
The first FTP client applications were interactive command-line tools, implementing
standard commands and syntax. Graphical user interface clients have since been developed for
many of the popular desktop operating systems in use today.
FTP operates on the application layer of the OSI model, and is used to transfer files
using TCP/IP. In order to do this an FTP server needs to be running and waiting for incoming
requests. The client computer is then able to communicate with the server on port 21. This
connection, called the control connection, remains open for the duration of the session, with a
second connection, called the data connection, either opened by the server from its port 20 to a
negotiated client port (active mode) or opened by the client from an arbitrary port to a negotiated
server port (passive mode) as required to transfer file data. The control connection is used for
session administration (i.e., commands, identification, passwords) exchanged between the client
and server using a telnet-like protocol. For example "RETR filename" would transfer the
specified file from the server to the client. Due to this two-port structure, FTP is considered
an out-of-band protocol, as opposed to an in-band protocol such as HTTP.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
The server responds on the control connection with three digit status codes in ASCII with
an optional text message, for example "200" (or "200 OK.") means that the last command was
successful. The numbers represent the code number and the optional text represent explanations
(e.g., <OK>) or needed parameters (e.g., <Need account for storing file>). A file transfer in
progress over the data connection can be aborted using an interrupt message sent over the control
connection.
FTP can be run in active or passive mode, which determines how the data connection is
established. In active mode, the client sends the server the IP address and port number on which
the client will listen, and the server initiates the TCP connection. In situations where the client is
behind a firewall and unable to accept incoming TCP connections, passive mode may be used. In
this mode the client sends a PASV command to the server and receives an IP address and port
number in return. The client uses these to open the data connection to the server.
While transferring data over the network, four data representations can be used:
•
•
•
•
ASCII mode: used for text. Data is converted, if needed, from the sending host's character
representation to "8-bit ASCII" before transmission, and (again, if necessary) to the receiving
host's character representation. As a consequence, this mode is inappropriate for files that
contain data other than plain text.
Image mode (commonly called Binary mode): the sending machine sends each file byte for
byte, and the recipient stores the bytestream as it receives it. (Image mode support has been
recommended for all implementations of FTP).
EBCDIC mode: use for plain text between hosts using the EBCDIC character set. This mode
is otherwise like ASCII mode.
Local mode: Allows two computers with identical setups to send data in a proprietary format
without the need to convert it to ASCII
For text files, different format control and record structure options are provided. These
features were designed to facilitate files containing Telnet or ASA formatting.
Data transfer can be done in any of three modes:
•
•
•
Stream mode: Data is sent as a continuous stream, relieving FTP from doing any processing.
Rather, all processing is left up to TCP. No End-of-file indicator is needed, unless the data is
divided into records.
Block mode: FTP breaks the data into several blocks (block header, byte count, and data
field) and then passes it on to TCP.[5]
Compressed mode: Data is compressed using a single algorithm (usually run-length
encoding).
Coast-to-Coast Surfing
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
The Web provides a means of accessing an enormous collection of information, including
text, graphics, audio, video, movies, and so on. One of the most exciting aspects of the Web is
that information can be accessed in a nonlinear and experimental fashion. Unlike reading a book
by flipping to the next page in sequential order, you can “jump” from one topic to another via
hyperlinks. This nonlinear approach to information gathering, or browsing is sometimes referred
to as “coast-to-coast surfing”.
HTML
HyperText Markup Language (HTML) is the predominant markup language for web pages.
HTML elements are the basic building-blocks of web pages.
HTML Tags
HTML markup tags are usually called HTML tags
• HTML tags are keywords surrounded by angle brackets like <html>
• HTML tags normally come in pairs like <b> and </b>
• The first tag in a pair is the start tag, the second tag is the end tag
• Start and end tags are also called opening tags and closing tags
HTML Documents = Web Pages
HTML documents describe web pages
HTML documents contain HTML tags and plain text
HTML documents are also called web pages
HTML elements form the building blocks of all websites. HTML allows images and
objects to be embedded and can be used to create interactive forms. It provides a means to
create structured documents by denoting structural semantics for text such as headings,
paragraphs, lists, links, quotes and other items. It can embed script sin languages such
as JavaScript which affect the behavior of HTML web pages.
Web browsers can also refer to Cascading Style Sheets (CSS) to define the appearance and
layout of text and other material. The W3C, maintainer of both the HTML and the CSS
standards, encourages the use of CSS over explicitly presentational HTML markup.
Web Page Installation
In order to view web pages, one needs to install them on the Web Server. A Web Server is
a program, located on a computer with internet access that responds to a browser’s request for a
URL.
Basic Principles
Basic principles for web page installation are:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
You need to have Web pages to publish.
A Web Server where the files must be placed must be available to you.
The permissions on the files need to be set so that any user anywhere can read them.
When someone requests your web page, the server has to deliver it.
Web Page Setup
Web pages are created with the help of HTML (Hyper Text Markup Language). The pages
are set up with the help of the tags available in HTML. Some of them are:
Head tag The <HEAD> tag has no attributes. Several other tags can be included inside it.
Basefont tag The <BASEFONT> tag defines the font size to be used in the HTML
document and may be included in the head of the document.
Base tag The <BASE> tag is useful for setting some global parameters of an HTML
document and may be included in the head of the document. A global parameter is an
attribute that has an effect on the entire document.
Meta tag etc. The <META> tag is used to include additional information about a
document and can be used to pass additional information to a browser. There is no ending
for a <META> tag and a document can have multiple <META tags.
Basics of HTML
HTML is short for HyperText Markup Language.
• Hypertext is simply a piece of text that works as a link.
• Markup Language is a way of writing layout information within documents.
Basically an HTML document is a plain text file that contains text and nothing else. When
a browser opens an HTML file, the browser will look for HTML codes in the text and use them
to change the layout, insert images, or create links to other pages. Since HTML documents are
just text files they can be written in even the simplest text editor
Brief HTML Background
HTML has not been around for many years. November 1990 marks the day of the first web
page and back then there were little to no HTML standards to be followed. A group called the
World Wide Web Consortium was then formed and has since set the standards that are widely
accepted and we will base our teachings around them.
Web Pages
Web pages have many uses. Here are some important facts about why web pages are so useful.
• A cheap and easy way to spread information to a large audience.
• Another medium to market your business.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
Let the world know about you with a personal website!
Words to Know
• Tag - Used to specify ("mark-up") regions of HTML documents for the web browser to
interpret. Tags look like this: <tag>
• Element - A complete tag, having an opening <tag> and a closing </tag>.
• Attribute - Used to modify the value of the HTML element. Elements will often have
multiple attributes.
For now just know that a tag is a command the web browser interprets, an element is a
complete tag, and an attribute customizes or modifies HTML elements.
HTML Head Section
HTML Head Tag
The <head> tag is a part of basic structure of HTML documents. It is intended for keeping
technical and some other data of web-page. These do not show on the screen (except for <title>
tag).
List of tag's which are placed inside <head> tag.
<base>
Determines a base address of current document. It has two attributes:
href - the address which should be used for the creation of a full path to files.
target - the name of window or frame where links will be open.
<basefont> Determines a default font of document. It has three attributes: color - determines
color of the text
face - determines a face of font.
size - determines a size of font (may have values from 1 to 7). Default value is 3.
<link> Links an internal file to a HTML document (for example, CSS file).
<meta> Determines metatags which contain information for browsers and search systems.
<script> It is intended for the description of scripts.
<style> Determines styles of the web page.
<title> Creates a web-page's title which shows in the title of a browser window. Requires a
closing tag. If it is not determined, browser will show page file name.
Example
<head>
<title>Title of the page
</title>
</head>
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
It's a basic example of using <head> tag. On the picture you may see title of page, determined in
<title> tag.
Example
<head>
<base href="http://yoursite.com/www/" target="_blank">
<basefont face="sans-serif" color="darkblue">
<title>Example of head tag</title>
</head>
This example shows how you can use <head> tag for basic formatting of web-page. You
will receive the page with sans-serif dark blue font of text. All links will be open in new window.
The HTML Body Section
When you create a blank HTML document, if the body section is left blank you will see
nothing on the screen. The <body> tag is the central and most important part in an HTML
document. In fact, it is needed to be able to see anything on the screen. While the header tag is
important also, mostly every standard tag in HTML goes into the body. It is the core of the page.
List of <body> tag's attributes
Alink: Determines a color of active link (when mouse button pressed).
Background: Determines a background image.
Bgcolor: Determines a background color
Bgproperties: Determines either background will be scrolled with content of page or not. Have
one value "fixed" only.
Link: Determines color of hyperlinks.
Vlink: Determines color of visited hyperlinks.
Text: Determines color of text on page.
Scroll: Determines either show scroll bars or no.
bottommargin, leftmargin, topmargin: Margins from bottom, left or top edge of browser
window.
The body tag can be used to control the background color of the document by setting the
attribute "bgcolor" using a hex value (see the tutorial on Colors for details). You can add other
attributes to control the link and text colors and they will be the defaults for the web page you are
attempting to build. Additionally, you can set an image to become the background through the
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
background attribute. For the image to load in all popular browsers, it is recommended to be in
the jpeg format as it generally loads faster than gif or png images.
If image is not found or browser don't show pictures, image will not appeared. Background
will have color which determines by "bgcolor" tag.
Formatting
HTML Text Formatting Tags: There are 3 types of text formatting tags:
1. Text Phrase Tags
<strong> Makes the text appear in a strong bold way.
Example
<strong>Strong Text</strong>
Strong Text
<em>
Makes the text appear in an emphasized way.
Example
<em>Emphasized Text</em>
Emphasized Text
<code>
Makes the text appear as computer code.
Example
<code>Computer Code Text</code>
Computer Code Text
<samp> Makes the text appear as sample computer code.
Example
<samp>Sample Computer Code Text</samp>
Sample Computer Code Text
<cite>
Makes the text appear as a citation.
Example
<cite>Citation Text</cite>
Citation Text
You can also combine any of these tags together for a "mixed" result:
<strong><em>Strong Emphasized Text</em></strong>
Strong Emphasized Text
2. Text Style Tags
<tt> Makes the text appear as mono spaced or teletype
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Example
<tt>Mono Spaced Text</tt>
Mono Spaced Text
<small> Makes the text appear as small text.
Example
<small>Small Text</small>
Small Text
<big> Makes the text appear as big text.
Example
<big>Big Text</big>
Big Text
<i> Makes the text appear as italic (Identical to the <em> tag).
Example
<i>Italics Text</i>
Italics Text
<b> Makes the text appear as bold text (Identical to the <strong> tag).
Example
<b>Bold Text</b>
Bold Text
You can also combine any of these tags together for a "mixed" result:
<b><big>Bold Big Text</big></b>
Bold Big Text
3. Text "Alignment" Tags
<pre> Text has been pre-formatted if used.
Example
<pre>
Pre formated text that
will keep both
spaces and
line breaks.
</pre>
Pre formated text that
will keep both
spaces and
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
line breaks.
<blockquote> Used to display long quotations.
Example
<blockquote>
Basically an HTML document is a plain text file that contains text and nothing else. When a
browser opens an HTML file, the browser will look for HTML codes in the text and use them to
change
the
layout,
insert
images,
or
create
links
to
other
pages.
Since HTML documents are just text files they can be written in even the simplest text editor
</blockquote>
And here, we have a LONG quotation:
Basically an HTML document is a plain text file that contains text and nothing else. When a
browser opens an HTML file, the browser will look for HTML codes in the text and use them to
change
the
layout,
insert
images,
or
create
links
to
other
pages.
Since HTML documents are just text files they can be written in even the simplest text editor
<q> Used to display short quotations. Will automatically place quotations around the text.
Example
<q>
Here we have a small quotation. This tag will automatically place quotations around the text.
</q>
Here we have a small quotation. This tag will automatically place quotations around the text.
<p> Used to define a paragraph.
Example
<p>
Paragraph Text goes here
</p>
Paragraph Text goes here.
<br /> Used to insert a single line break in the text. (There is no end tag, so <br><br /> is
wrong).
Example
I am on one line and <br /> then I am on another.
I am on one line and
then I am on another.
Header Tags
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
<h1> Makes the text appear as the largest header.
<h6> Makes the text appear as the smallest header.
Example
<h1>Header 1</h1>
Header 1
<h2>Header 2</h2>
Header 2
<h3>Header 3</h3>
Header 3
<h4>Header 4</h4>
Header 4
<h5>Header 5</h5>
Header 5
<h6>Header 6</h6>
Header 6
Hyperlinks
Hyperlinks can take the form of linking to one web page to another web page, opening an
email or FTP client, or call for some other action. They are how we get from point A to point B
on the World Wide Web; they are what make the web user friendly and convenient. A hyperlink
can also move you from one point to another within a single page by using the "#" symbol.
Creating Hyperlinks
We use <A> element (A stands for anchor) to create hyperlinks in HTML. The most
common form of hyperlink is undoubtedly the text hyperlink, where the hyperlink itself usually
appears underlined and in a different color from the surrounding text to see it off from that text.
Creating Text Hyperlinks
The standard form of a hyperlink element looks like this:
Find the answers at <A HREF=http://W3C.org>W3C</A>.
<A> tag is used to set up the a hyperlink and HREF attribute to set the target of the hyperlink to
http://W3C.org (which is the home page for the World Wide Web Consortium). This the URL
that browser will navigate to when the user clicks the link. The text inside the <A> element will
appear in the hyperlink style for the page.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Example
<HTML>
<HEAD>
<TITLE>
Creating A Hyperlink
</TITLE>
</HEAD>
<BODY>
<CENTER>
<H1>
Creating A Hyperlink
</H1>
Here is a Website to Check Out...
<A HREF="HTTP://W3C.ORG">W3C</A>!
</CENTER>
</BODY>
</HTML>
The results of this HTMLappear in following figure:
Creating Graphical Hyperlinks
In addition to text, you can also use images as hyperlinks. Doing so is easy to do – just put
an <IMG> element in the <A> element instead of the text. Here is an example:
<HTML>
<HEAD>
<TITLE>
Creating A Graphical Hyperlink
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
</TITLE>
</HEAD>
<BODY>
<CENTER>
<H1>
Creating A Graphical Hyperlink
</H1>
<A HREF="http://W3C.ORG">
<IMG
WIDTH=110
HEIGHT=110
Settings\Meenakshi\My Documents\My Pictures\flowers.gif"
ALT="Click me to go to W3C">
</A>
</CENTER>
</BODY>
</HTML>
SRC="C:\Documents
and
The results of this HTML appear in following figure. When the user clicks the image in the
figure, the browser navigates to the hyperlink’s target, http://W3C.org
Linking to a Section of a Document
It is also possible to link to a section of a document instead of linking to the document as a
whole. Anchors can be used. Creating anchors is another valuable use of the <A> element.
Anchors supply a name to a section of a page, so you can use the anchor’s name to navigate to
that section.
Example
<HTML>
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
<HEAD>
<TITLE>
Linking to A Section In A Page
</TITLE>
</HEAD>
<BODY>
<CENTER>
<H1>
Linking to A Section In A Page
</H1>
Click here to go to the
<A HREF="#BOTTOM">bottom</A>
of the Page.
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<HR>
<A NAME="BOTTOM">This is the bottom of the page.</A>
</CENTER>
</BODY>
</HTML>
Results are shown in the figures given below:
Figure: Creating an anchored Hyperlink
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Figure: Navigating to an Anchor
Creating Navigational Aids with Hyperlinks
One popular use of hyperlinks is to make it easy to navigate around a web site using image
buttons, like arrows. Here is an example that displays arrows to let the user navigate to the next
or previous page in a series of pages, or to navigate to the home page just by clicking the
appropriate image:
<HTML>
<HEAD>
<TITLE>
Creating Graphical Navigational Aids
</TITLE>
</HEAD>
<BODY>
<CENTER>
<H1>
Creating Graphical Navigationa Aids
</H1>
Want to get somewhere fast? Click a button below...
<BR>
<A HREF="prev.html">
<IMG
WIDTH=172
HEIGHT=117
Settings\Meenakshi\My Documents\My Pictures\left.gif"
ALT="Previous" BORDER=0>
</A>
SRC="C:\Documents
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
and
<A HREF="index.html">
<IMG
WIDTH=161
HEIGHT=105
Settings\Meenakshi\My Documents\My Pictures\home.gif"
ALT="Home" BORDER=0>
</A>
<A HREF="next.html">
<IMG
WIDTH=172
HEIGHT=117
Settings\Meenakshi\My Documents\My Pictures\right.gif"
ALT="Next" border=0>
</A>
</CENTER>
</BODY>
</HTML>
SRC="C:\Documents
and
SRC="C:\Documents
and
The result of this HTML appears in the figure given below:
Using Front Page Express and Plug-ins
Overview
FrontPage Express is a Hyper Text Markup Language (HTML) Editor. FrontPage Express
is a simpler version of FrontPage. Once you have mastered FrontPage Express, it would be very
easy to upgrade to FrontPage to allow for more details to your web page.
FrontPage Express is very similar to Word97.
Toolbar
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Text
Entering text into a webpage is much like entering text into a word processor. Simply type
the text you want to appear and then use the following steps to spice it up.
Layout
The text on your webpage doesn't have to all be in paragraph blocks. You do something:
Line Break
When you press ENTER at the end of a line of text, the cursor drops down two lines and
starts a new paragraph. The only way to get text directly underneath the first line of text
is to finish filling up the line and letting word-wrap do the rest But sometimes you want
to go to the very next line after only a few words. An example of this is a centered
heading:
Jenny Kiaschko
Ed Psy 490NET
•
•
•
This is called a Line Break. To create a line break, simply hold down the SHIFT key
and press ENTER.
Alignment
You can align text and pictures to the right, center, or left of your webpage. To do this,
highlight the text or picture you want to move and click on either the right, center, or left
buttons on the toolbar. If you haven't started typing the text, just click on either the right,
center, or left buttons and the cursor will move to that part of the page.
Indents
You can indent blocks as text as well. To indent some text, click the Increase Indent
Icon on the toolbar. To out-dent or un-indent some text, click the Decrease Indent
Icon on the toolbar. When you indent or out-dent a block of text, the entire paragraph that
the text is in is indented or out-dented. So be careful when using indent and out-dent,
especially inside of lists.
Lists
You can also make lists. Lists are indented and denoted and are especially good for
outlines. Here is an example of the two major kinds of lists, the Numbered List and
the Bulleted List:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Numbered List
•
•
•
•
Bulleted List
Apples
Oranges
Kiwi
Tomatoes
o
o
o
o
Dogs
Cats
elephants
Sheep
To make a list, select either the Numbered List or Bulleted List Icon from the toolbar.
Type the text of the first list item. When you hit ENTER, the cursor drops down to the next line
(not a new paragraph) and another number or bullet appears for the next list item. To end the list,
press ENTER after you've typed the last list item. Then, deselect the selected List Icon. The
cursor will then drop down to a new paragraph and will be out-dented to the indent before the list
was started.
In the case of outlines, you may want to nest lists, or have a list inside of another list. It
would look something like this
o Math Department
o
Calculus
•
• Jenny Kiaschko
• Nancy Pence
Algebra
•
• Matt Reed
• Joby Crum
Geometry
•
• Robin Ehrhart
• Jenny Kiaschko
• Erin Scheffler
o Science Department
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
and so...
build a nested list, start by creating the top most list, or parent. (In the case above, you'd make
a Numbered List and type in the first item.) Then to make a sub-list of that item, do the
following:
o Press ENTER after typing in the list item of the parent list.
o Click the Increase Indent Icon.
o Select the either the Numbered List or Bulleted List Icon from the toolbar. (In
the case above, you'd select Numbered List.)
o Type in the first item of the nested list.
To end a sub-list and return to its parent list (In the example above, end the list
containing Mike Loosbrock and Matt Christians and get back to list containing Work
Study, Part-Time Employees, and Staff), do the following:
•
•
Press ENTER after typing in the last item of the sub-list.
Either press BACKSPACE twice, or click the Decrease Indent Icon twice.
Attributes
FrontPage Express allows you to make all the same attribute changes you can make in
Word97. The first step in changing text attributes is to highlight the text you want to modify with
the mouse. You can then make the following changes:
1. Font Type
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Font type is the font family of text, such as Comic Sans, Times New Roman, and Courier
New. To change the font type, select the font you want from the Font Type List Box on
the toolbar. (Try not to use a lot of non-standard fonts because if the font is not loaded on
the computer where your page is being viewed, the font will appear as the browser
default.)
1. Font Style
The style of the text can either be bold, italics, or underline. To change the font style,
select one or more of the Style Icons on the toolbar.
• Font Color
The color of the text can also be changed. To change the font color, select the Text Color
Icon on the toolbar. The Color Dialog Box appears. Choose the color you want and click
OK.
• Font Size
You
can
change
the
font
size
by
clicking
the
either
the Increase TextSize or Decrease Text Size Icon from the toolbar.
Images
You can insert images (*.gif, *.jpg, *.bmp) into your webpage. Keep in mind that you
need to keep your images relatively small in size, otherwise, your pages will take a long time to
download.
To insert an image, put your cursor where you want to place the image and then:
1) Select the Insert Image icon from the toolbar.
2) The Image Dialog Box appears. Click the Browse Button.
3) Find and select the image you wish to insert and click OK.
The image should appear on the webpage. After you have placed the image on the
webpage, you can change the attributes of the image by right clicking on the image and
choosing Image Properties.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
The Image Properties Dialog Box appears. Choose the Appearance Tab..
Links
Links create a connection
on between more than one of your pages. Links also can connect
your page to other pages across the World Wide Web.
To link to a webpage other than your own, determine where you want to link to (For
example, you might want the viewer to click on the words "CNN News" and have them sent
to http://www.cnn.com). To do this, first highlight the text, picture, or both, that you want to be
linked (in this case, we would highlight the words "CNN News"). Next click the Create or Edit
Hyperlink Icon on the toolbar.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH
NH-71
71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail
mail : [email protected]
The Create Hyperlink Dialog Box should appear, as below. Choose the World Wide Web
tab. Then make sure the Hyperlink Type List Box is set to "http:" on the Hyperlink Type List
Box. Lastly, on the line titled URL type the address of the webpage. In this case we would type
out http://www.cnn.com. Click the OK and you have just created a link that should look and
work something like this link: CNN News.
To link your own pages together, you first need to determine how the pages are to be
connected. For example, you may want the viewer to click on the word "Hobbies", and have it go
to a separate page of yours. To do this, follow the same directions as above: highlight the text
and click the Create or Edit Hyperlink Icon on the toolbar.
The Create Hyperlink Dialog Box should appear, as below. Choose the World Wide Web
tab. Next, select "(other)" for the Hyperlink Type:. On the URL line type the name of your
other page. In this case we would type "hobbies.htm". Once that is done you can click the OK
and you will have created a link to another one of your pages.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Special Features
The one line text box allows you to add a box for interactive typing, such as the one below.
The scrolling text box allows you to add a scrolling text box for more information than a one
line text box can handle. This is a good way to ask for a great amount of information while
using minimal space.
The check box allows you to add a box to gather information in a yes/no format.
Please Vote for One Person
Jennifer
Jason
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Brian
The radio button box gives you the same capabilities as the check box only in a radio button
form.
Please Vote for One Teacher
Jim Levin
Sandy Levin
Michael Waugh
The drop down menu box allows you to give a list of choices in a compressed amount of space.
Jennifer
Jason
The push button box allows you to add a button for different tasks: submit or reset.
Submit
Reset
The tools listed above are extremely useful because it allows you to add higher level
features to your web page without having to know any type of coding.
Plug-ins
In computing, a plug-in (or plug-in) is a set of software components that adds specific
capabilities to a larger software application. If supported, plug-ins enables customizing the
functionality of an application. For example, plug-ins is commonly used in web browsers to play
video, scan for viruses, and display new file types. Well-known plug-ins examples include
Adobe Flash Player and QuickTime.
Applications support plug-ins for many reasons. Some of the main reasons include:
• to enable third-party developers to create capabilities which extend an application
• to support easily adding new features
• to reduce the size of an application
• to separate source code from an application because of incompatible software licenses
Specific examples of applications and why they use plug-ins:
• Email clients use plug-ins to decrypt and encrypt email.
• Graphics software use plug-ins to support file formats and process images (Adobe
Photoshop)
• Media players use plug-ins to support file formats and apply filters
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
• Microsoft Office uses plug-ins (better known as add-ins) to extend the capabilities of its
application by adding custom commands and specialized features
• Software development environments use plug-ins to support programming languages
• Web browsers use plug-ins to play video and presentation formats
(Flash, QuickTime, Microsoft Silverlight, 3DMLW)
Section C: Languages
Basic and Advanced HTML
Presenting and Arranging Text
Using Paragraphs and Line Breaks
<P> tag starts a new paragraph and <BR> tag allows you to skip to the next line of text. For
example:
<HTML>
<HEAD>
<TITLE>
Using the &lt; P &gt; and &lt; BR &gt; tags
</TITLE>
</HEAD>
<BODY>
Here is a line of text.
<BR>
Using the &lt; BR &gt; tag skips to the next line.
<P>
On the other hand, using the &lt; P&gt; tag
starts a new paragraph.
</P>
</BODY>
</HTML>
The results are shown in the figure given below:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Using <DIV> and <SPAN>
Two important formatting elements are the <DIV> and <SPAN> elements. These elements will
become very useful when working with style sheets (to be covered later). Using <DIV> (which
stands for division) and <SPAN>, you can specify a range of text and style it as you want it.
<DIV> is used to select a block of text and <SPAN> to select text inline. Here is an example
using the <DIV> tag with its ALIGN parameter to set the alignment of text without using the
<P> tag:
<HTML>
<HEAD>
<TITLE>
Using the &lt;DIV&gt; tag
</TITLE>
</HEAD>
<BODY>
<DIV ALIGN="LEFT">
Manager
<BR>
SlowPoke Products Inc.
<BR>
USA
</DIV>
<P>
Dear You:
<DIV ALIGN="CENTER" STYLE="color: red; font-style: italic">
When are you going to ship my order?
</DIV>
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
<DIV ALIGN="RIGHT">
<P>
President
<BR>
NeedItNow, Inc.
<BR>
Speedy, CO
</DIV>
</BODY>
</HTML>
The results appear in following figure:
On the other hand <SPAN> can be used to mark sections of text inline or text in the midst of the
other text. For example:
<HTML>
<HEAD>
<TITLE>
Using the &lt;SPAN&gt; tag
</TITLE>
</HEAD>
<BODY>
This is <SPAN STYLE="font-style: italic">not</SPAN> going to do!
</BODY>
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
</HTML>
The result of this HTML appears in the following figure:
Specifying the Font - <FONT>
The <FONT> tag lets you select the size, color and face of the text. For example:
<HTML>
<HEAD>
<TITLE>
Using the FONT tag
</TITLE>
</HEAD>
<BODY>
<FONT SIZE=6 COLOR="RED" FACE="Arial">Here is some text.</FONT>
</BODY>
</HTML>
The results appear in the following figure:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Setting the Base Font - <BASEFONT>
This element sets the font for the default text enclosed in the element, replacing the default font
used by the browser. You can specify relative sizes with respect to this default font with the
<FONT> tag. In the following example, I’m setting the base font size to 4 (possible values range
from 1 through 7), then temporarily increasing that size to 6 for one word with a <FONT> tag by
adding 2 to the base font size.
<HTML>
<HEAD>
<BASEFONT SIZE=4>
<TITLE>
Using the BASEFONT tag
</TITLE>
</HEAD>
<BODY>
Here
is
some
<FONT
FACE="Arial">bigger</FONT>text.
</BODY>
</HTML>
SIZE="+2"
COLOR="RED"
The results appear in the following figure:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Making Text Blink - <BLINK>
This tag makes the text to blink. For example:
<HTML>
<HEAD>
<BASEFONT SIZE=4>
<TITLE>
Using the BLINK tag
</TITLE>
</HEAD>
<BODY>
<BLINK> Happy New Year!!! </BLINK>
</BODY>
</HTML>
The results appear in the figure given below:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Note:- This tag is not supported by all the browsers.
Creating Horizontal Rules - <HR>
Draws a horizontal line to separate or group vertically. A horizontal rule is a horizontal line
that serves to break up a page or to group items together. Some of the attributes of this tag are
ALIGN, COLOR, NOSHADE, SIZE, STYLE and WIDTH.
Here is an example showing a number of ways to display and align horizontal rules:
<HTML>
<HEAD>
<TITLE>
Using the &lt;HR&gt; tag
</TITLE>
</HEAD>
<BODY>
Here is what &lt;Hr&gt; looks like:
<HR>
<BR>
Here is what &lt;HR ALIGN=LEFT WIDTH=80%&GT; looks like:
<HR ALIGN=LEFT WIDTH=80%>
<BR>
Here is what &lt;HR ALIGN=CENTER WIDTH=80%&GT; looks like:
<HR ALIGN=CENTER WIDTH=80%>
<BR>
Here is what &lt;HR ALIGN=RIGHT WIDTH=10&GT; looks like:
<HR ALIGN=RIGHT WIDTH=10>
<BR>
Here is what &lt;HR SIZE=10 NOSHADE&GT; looks like:
<HR ALIGN=CENTER SIZE=10 NOSHADE>
</BODY>
</HTML>
Following figure shows the results:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Centering Text - <CENTER>
This tag centers its enclosed text in the Web browser.
Here is an example of <CENTER> at work centering multiline text:
<HTML>
<HEAD>
<TITLE>
Using the &lt;CENTER&gt; tag
</TITLE>
</HEAD>
<BODY>
<CENTER>
As you can see.
<BR>
the &lt;CENTER&gt; tag
<BR>
can center multi-line text.
</CENTER>
</BODY>
</HTML>
The results are shown in the following figure:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Displaying Text In A Scrolling Marquee - <MARQUEE>
This tag displays scrolling text in a “marquee” style. Some of the attributes of this tag are:
• ALIGN – Sets the alignment of the text relative to marquee. Its values can be TOP
(default), MIDDLE or BOTTOM.
• BEHAVIOR – Sets how the text in the marquee should move.
• SCROLL – (the default; text scrolls the marquee), SLIDE (text enters from one side and
stops at the other side), or ALTERNATE (text seems to bounce from one side to the
other).
• BGCOLOR – Sets the background color for the marquee box.
• DIR – Gives the direction of the text. Possible values: LTR: left to right text or table and
RTL: right to left text or table.
• DIRECTION – Sets the direction the text should scroll. Can be LEFT (the default),
RIGHT, DOWN, or UP.
Here is an example showing various <MARQUEE> options at work:
<HTML>
<HEAD>
<TITLE>
Using Marquee element
</TITLE>
</HEAD>
<BODY>
<MARQUEE ALIGN="TOP" LOOP="INFINITE" BEHAVIOR="BOUNCE"
BGCOLOR="GREEN" DIRECTION="RIGHT">
<H2>
Here's a marquee!
</H2>
</MARQUEE>
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
<CENTER>
<H1>
Using Marquees
</H1>
</CENTER>
<MARQUEE ALIGN="LEFT" LOOP="INFINITE" BEHAVIOR="SCROLL"
BGCOLOR="RED" WEIGHT=40 WIDTH=300 DIRECTION="DOWN">
<H2>
Here's another marquee!
</H2>
</MARQUEE>
<MARQUEE ALIGN="TOP" LOOP="INFINITE"
BGCOLOR="0000FF" WIDTH=100% DIRECTION="RIGHT">
<H2>
Here's a marquee!
</H2>
</MARQUEE>
BEHAVIOR="SLIDE"
</BODY
</HTML>
The results are shown below:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Images in Web Pages
Adding an Image to a Web Page - <IMG>
This tag inserts an image into a web page. Some of the attributes of this tag are:
SRC = "text string"
SRC tells where to get the picture that should be put on the page. SRC is the one required
attribute for <IMG ...>. For example, suppose that the GIF file "../graphics/pumpkin.gif" is in the
same directory as this page.
ALT (text)
The "alt" attribute defines an alternate text designed to be a textual replacement for objects that
are usually not supported by some browsers. It also serves as additional information for browsers
that do support these objects (images, forms and applets). Browsers may display this text as a
tool tip when the mouse is over the object.
ALIGN
This attribute specifies the alignment of the element. These three values set the element's
position with respect to the surrounding text.
• bottom: Means that the bottom of the object should be vertically aligned with the current
baseline. This is the default value.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
middle: Means that the center of the object should be vertically aligned with the current
baseline.
• top: Means that the top of the object should be vertically aligned with the top of the
current text line.
These two values set the position of a floating element:
• left: Cause the image to float to the current left margin.
• right: Cause the image to float to the current right margin.
WIDTH (length)
Assigns a width to the element.
HEIGHT(length)
Assigns a height to the element.
BORDER (pixels)
Specifies the element's border width.
HSPACE (pixels)
This attribute works as a margin for the element, defining the amount of white space to be
inserted at the left and right sides of the element.
VSPACE (pixels)
This attribute works as a margin for the element, defining the amount of white space to be
inserted at the top and bottom sides of the element.
<HTML>
<BODY>
<H2>Norwegian Mountain Trip</H2>
<IMG BORDER="0" SRC="/images/pulpit.jpg" ALT="Pulpit rock" WIDTH="304"
HEIGHT="228" >
</BODY>
</HTML>
The result is shown below:
Norwegian Mountain Trip
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Creating Lists
Lists let you display information in a compact and tight format. There are three kinds of lists:
• Unordered Lists
• Ordered Lists
• Definition Lists
Unordered Lists
You can create unordered lists with elements like <UL>. Each item in the list gets its own
element using the <LI> list item tag. Here is an example showing how to create a bulleted list:
<HTML>
<HEAD>
<TITLE>
An Unordered List
</TITLE>
</HEAD>
<BODY>
<H1 ALIGN=CENTER>
Creating an Unordered List
</H1>
Here are some items to consider when buying a computer:
<UL>
<LI> Speed
<LI> Cost
<LI> RAM
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
<LI> Disk Space
<LI> CD ROM Speed
</UL>
</BODY>
</HTML>
The result is shown in the following figure:
Ordered Lists
While unordered lists display a simple bullet before each list item, ordered lists use a
number system or alphabets to indicate that the items are ordered in some way. For example:
<HTML>
<HEAD>
<TITLE>
An Ordered List
</TITLE>
</HEAD>
<BODY>
<H1 ALIGN=CENTER>
Creating an Ordered List
</H1>
Here are some items to consider when buying a computer:
<OL>
<LI> Speed
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
<LI> Cost
<LI> RAM
<LI> Disk Space
<LI> CD ROM Speed
</UL>
</BODY>
</HTML>
The result is shown in the figure below:
Definition Lists
These lists include both terms and their definitions. <DL> element is used to create these lists,
<DT> for terms, and <DD> for the definition of each term. For example:
<HTML>
<HEAD>
<TITLE>
A Definition List
</TITLE>
</HEAD>
<BODY>
<H1 ALIGN=CENTER>
Creating a Definition List
</H1>
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Here are some items to consider when buying a computer:
<DL>
<DT> Speed <DD> CPU speed in Megahertz.
<DT> Cost <DD> Make sure to keep this down.
<DT> RAM <DD> Amount of memory in the computer.
<DT> Disk Space <DD> Get plenty of Gigabytes.
<DT> CD ROM Speed <DD> Get at least 24X
</DL>
</BODY>
</HTML>
The result is shown below:
Creating Tables
<TABLE> element is used to create tables. It encloses elements like <CAPTION>, <TR>,
<TH>, <TD>, <COLSPAN>, <COL>, <THEAD>, <TBODY> etc.
Creating a basic table
The basic structure of an HTML table consists of the following tags:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
•
•
Table tags: <TABLE> </TABLE>
Row tags: <TR> </TR>
Cell tags: <TD> </TD>
Constructing an HTML table consists of describing the table between the beginning table
tag, <TABLE>, and the ending table tag,</TABLE>. Between these tags, you then construct
each row and each cell in the row. To do this, you would first start the row with the beginning
row tag, <TR>, and then build the row by creating each cell with the beginning cell tag, <TD>,
adding the data for that cell, and then closing the cell with the ending cell tag, </TD>. When you
finish all of the cells for a row, you would then close the row with the ending row
tag, </TR>.Then, for each new row, you would repeat the process of beginning the row, building
each cell in the row, and closing the row.
The following table is an example of a basic table with three rows and two columns of
data.
Data 1 Data 2
Data 3 Data 4
Data 5 Data 6
The codes that generated this table look like this:
<TABLE>
<TR>
<TD>Data 1</TD>
<TD>Data 2</TD>
</TR>
<TR>
<TD>Data 3</TD>
<TD>Data 4</TD>
</TR>
<TR>
<TD>Data 5</TD>
<TD>Data 6</TD>
</TR>
</TABLE>
This table contains no border, title, or headings. If you wish to add any of these elements
to your table, you need to include additional HTML codes.
Adding a border, title, and headings
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
In addition to the basic table tags, several options are available for adding additional
elements to your table. For example, if you add a border, title, and column headings to the table
in the previous section, the table would then resemble the following:
TABLE TITLE
Column A Column B
Data 1
Data 2
Data 3
Data 4
Data 5
Data 6
The following codes generated the border, TABLE TITLE, and Column A and Column B
headings for this table:
<TABLE BORDER="5">
<TR>
<TH COLSPAN="2">
<H3><BR>TABLE TITLE</H3>
</TH>
</TR>
<TH>Column A</TH>
<TH>Column B</TH>
Notice that the beginning table tag, <TABLE>, now includes the border
tag, BORDER="5", which places a border around the table and frames each cell. The number
that you ascribe to the border tag, BORDER=n, sets the width of the table border. Depending on
how you design your table, you can then determine the border size that best suits your table and
the overall design of your web page.
To add a title to your table, you would place the title and the attributes of that title between
the row commands, <TR> and </TR>. The heading codes, <TH> and </TH>, define a heading
cell and, by default, these codes center the heading and set it in bold type. However, if you want
the title to span across the columns below it, you need to include the COLSPAN=n code. Since
this table has two columns, the COLSPAN="2" code was necessary. To add emphasis to the
header, you can use the header commands to make the text larger. In this table, notice that
the <H3> and </H3> commands made the title larger. Finally, the <BR> tag created a space
above the title.
The individual column headings are also described by the heading
codes, <TH> and </TH>. Since these codes, by default, center the heading and set it in bold
type, no additional commands or attributes were included in the heading commands.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Polishing your table
To give your table a more polished look, you can include commands that will adjust the
size of your table, add space in the cell, add space between rows, and align the data in a cell.
Working with these commands is basically a process of trial and error to create the most
appealing presentation of your information. The type of table that you create and the overall
design of your web site will help you determine what works best for your table.
Some of the commands that enable you to customize your table include:
• The WIDTH=n% command sets the width of your table as a percentage of the screen.
The letter n designates the percentage that you assign to this command. For example, if
you want the width of your table to be one half the width of the screen, you would
include the WIDTH="50%" command in the beginning table command.
• The CELLPADDING=n command adjusts the vertical dimension of the cells. The
letter n designates the numerical value that you assign to this command.
• The CELLSPACING=n command sets the space or border around the cells. The
letter n designates the numerical value that you assign to this command.
• The ALIGN=(LEFT, RIGHT, or CENTER) command will horizontally align the data in
a cell. For example, if you wish to place the data in the center of each cell in a row, you
would include the ALIGN=CENTER command within the row command.
• The VALIGN=(TOP, MIDDLE, or BOTTOM) command will vertically align the data in
a cell. For example, if you wish to place the data in the center of each cell in a row, you
would include the ALIGN=MIDDLE command within the row command.
TABLE TITLE
Column A
Column B
Data 1
Data 2
The following codes, along with codes previously discussed, created this table:
<TABLE BORDER="5" WIDTH="50%" CELLPADDING="4"
CELLSPACING="3">
<TR>
<TH COLSPAN="2"><BR><H3>TABLE TITLE</H3>
</TH>
</TR>
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
<TR>
<TH>Column A</TH>
<TH>Column B</TH>
</TR>
<TR ALIGN="CENTER">
<TD>Data 1</TD>
<TD>Data 2</TD>
</TR>
</TABLE>
Notice that the TABLE command now includes the WIDTH="50%" command. This
command extends the table across one half of the width of the text. Also,
the CELLPADDING="4" command increases the vertical dimension of the cells, and
the CELLSPACING="3"command increases the border around the cells. Finally,
the ALIGN="CENTER" command places Data 1 and Data 2 in the center of the cell.
Working with Frames
Simply put, a frame is a web browser window within another web browser window. By
using frames, you can create web pages consisting of multiple windows.
Frames are related to one another in a manner determined by you, the web page author. For
example, you can set up your web page so that a link in a frame will call up a page in the same
frame, another frame, or the entire browser window.
Creating the frames
Let's suppose you want to create a web page consisting of two frames. The frame on the
left will contain a list of services. When you select a service, a corresponding description will
then appear in the right frame. Following figure shows a sample page:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
To create a page such as this, you first need to set up your main page or index.html file to
accommodate frames.
There are two HTML tags used for frames: <FRAMESET> and <FRAME>. The
<FRAMESET> tag sets the width of each frame as a percentage of the total width of the web
page. The <FRAME> tag assigns a name to each frame and indicates which file it will display.
Here is a sample index.html file that creates a web page with two frames. Note that the <Body>
tag normally found in HTML files is not needed.
<HTML>
<HEAD>
<TITLE>Computer Services</TITLE>
</HEAD>
<FRAMESET COLS="30%,70%">
<FRAME scrolling=yes SRC="links.html" NAME="left">
<FRAME SRC="intro.html" NAME="right">
</FRAMESET>
</HTML>
The FRAMESET COLS code sets up the frame size starting from left to right. So from
this example, you can see that the left frame will take up 30% of the page's width and the right
frame will take up 70% of the page's width.
Next, the FRAME code indicates:
• whether or not a scroll bar will automatically appear with the frame,
• the content that will appear in the frame by indicating the filename, and
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
the name of the frame.
In this case, the left frame will automatically contain a scroll bar, indicated by the FRAME
SCROLLING=YES code. This frame will display the file called links.html, indicated by the
source code shown as SRC. Finally, the NAME code indicates that the frame is appropriately
called left.
The right frame will not automatically contain a scroll bar since the SCROLLING code is
not included. (A scrolling bar will appear, however, if it is needed.) This frame will display the
file called intro.html and the name of this frame is right.
Note that the even though the example uses the NAME code, assigning names to the frames is
not required. It is helpful, however, to include it because the names give you as an easy way to
indicate in which frame you wish to target information.
So to recap, our sample code indicates that the file intro.html will contain introductory
material and will appear in the right frame when the web page opens. No frame codes are needed
in the intro.html file since it is simply an html file that displays in the right frame. A sample
intro.html file might look like this:
<HTML>
<HEAD>
<TITLE>Computer Services</TITLE>
</HEAD>
<BODY>
<P align=Center>
<IMG SRC="deptbanner.GIF">
<H1><Center>Computer Services</Center></H1>
<H3><Center>Introduction</Center></H3>
<P align=Center>
The Computer Services Department is responsible for supporting all the
company's computers and networks and providing information services such as
computer seminars, technical documentation, and publications.
</BODY>
</HTML>
Now that you have the information that will automatically open in the right frame, you can
continue by creating a file for the left frame.
Targeting information
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
The left frame will contain a file called links.html which will include links to other pages.
When someone clicks on a link, however, you can set it up so that the information appears in the
right frame.
To target information to the right frame, you must include the proper codes as shown in the
example file below:
<HTML>
<HEAD>
<TITLE>Computer Services</TITLE>
</HEAD>
<BODY>
<H3>Computer Services Topics</H3>
<P ALIGN=left>
<A HREF="intro.html" target="right">Introduction</A> <P>
<A HREF="helpdesk.html" target="right">Help Desk</A> <P>
<A HREF="seminars.html" target="right">Seminars</A> <P>
</BODY>
</HTML>
In the sample code, you can see the standard A HREF code is used to create a link. This
linking code also contains the target code which indicates where you want to display the
information. Our sample file is set up so that when someone selects a link, the resulting file
appears in the right frame. This is evident by the fact that the target tag is set to "right," which is
the name you assigned to the right frame in the index.html file. In addition, note that the
file intro.html appears not only when the web page opens, but also when you click on the
link Introduction in the left frame. It also assumes that you have created a helpdesk.html file
and a seminars.html file with all the relevant information.
Linking to other web pages
Besides linking to your own HTML files, you can also set the links in your frame to other
pages on the web. To do this, you would indicate the URL instead of a filename as in the
following example:
<A HREF="http://www.cnn.com" target="right">
Keep in mind, however, that if you set the link to a page that also has frames, the entire
page will be shown in the target frame, and you will have frames within frames. To avoid this,
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
don't set the link to appear in a frame. Instead, have it appear in its own window by eliminating
the target tag as in this example:
<A HREF="http://www.cnn.com">
JavaScript Language
What is JavaScript?
• JavaScript was designed to add interactivity to HTML pages
• JavaScript is a scripting language
• A scripting language is a lightweight programming language
• JavaScript is usually embedded directly into HTML pages
• JavaScript is an interpreted language (means that scripts execute without preliminary
compilation)
What's the difference between JavaScript and Java?
Actually, the 2 languages have almost nothing in common except for the name. Although
Java is technically an interpreted programming language, it is coded in a similar fashion to C++,
with separate header and class files, compiled together prior to execution. It is powerful enough
to write major applications and insert them in a web page as a special object called an "applet."
Java is not considered an easy-to-use language for non-programmers.
Javascript is much simpler to use than Java. With Javascript, if I want check a form for
errors; I just type an if-then statement at the top of my page. No compiling, no applets, just a
simple sequence.
What can a JavaScript do?
• JavaScript gives HTML designers a programming tool - HTML authors are normally
not programmers, but JavaScript is a scripting language with a very simple syntax!
Almost anyone can put small "snippets" of code into their HTML pages
• JavaScript can put dynamic text into an HTML page - A JavaScript statement like
this: document.write("<h1>" + name + "</h1>") can write a variable text into an HTML
page
• JavaScript can react to events - A JavaScript can be set to execute when something
happens, like when a page has finished loading or when a user clicks on an HTML
element
• JavaScript can read and write HTML elements - A JavaScript can read and change the
content of an HTML element
• JavaScript can be used to validate data - A JavaScript can be used to validate form
data before it is submitted to a server. This saves the server from extra processing
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
•
JavaScript can be used to detect the visitor's browser - A JavaScript can be used to
detect the visitor's browser, and - depending on the browser - load another page
specifically designed for that browser
JavaScript can be used to create cookies - A JavaScript can be used to store and
retrieve information on the visitor's computer
How to Insert a JavaScript into an HTML document
The HTML <script> tag is used to insert a JavaScript into an HTML page.
Writing to The HTML Document
The example below writes a <p> element with current date information to the HTML document:
<HTML>
<BODY>
<H1>My First Web Page</H1>
<SCRIPT TYPE="text/javascript">
document.write("Hello World!”);
</SCRIPT>
</BODY>
</HTML>
The results are shown below:
To insert a JavaScript into an HTML page, we use the <SCRIPT> tag. Inside the
<SCRIPT> tag we use the TYPE attribute to define the scripting language. So, the <SCRIPT
TYPE="text/javascript"> and </SCRIPT> tells where the JavaScript starts and ends.
JavaScript Statements
Unlike HTML, JavaScript is case sensitive.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
A JavaScript statement is a command to a browser. The purpose of the command is to tell the
browser what to do.
Following JavaScript statement tells the browser to write "Hello World!" to the web page:
document.write("Hello World!");
JavaScript Variables
Variables are "containers" for storing information. Rules for JavaScript variable names:
• Variable names are case sensitive (y and Y are two different variables)
• Variable names must begin with a letter or the underscore character
Note: Because JavaScript is case-sensitive, variable names are case-sensitive.
Declaring JavaScript Variables
You declare JavaScript variables with the var keyword:
var x;
var carname;
After the declaration shown above, the variables are empty (they have no values yet).
However, you can also assign values to the variables when you declare them:
var x=5;
var carname="Volvo";
JavaScript Operators
JavaScript Arithmetic Operators
Arithmetic operators are used to perform arithmetic between variables and/or values. Following
table lists arithmetic operators available in JavaScript:
Operator
Description
+
Addition
-
Subtraction
*
Multiplication
/
Division
%
Modulus (division remainder)
++
Increment
--
Decrement
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
JavaScript Assignment Operators
Assignment operators are used to assign values to JavaScript variables. Following table lists
assignment operators:
Operator
Example
Same As
=
x=y
+=
x+=y
x=x+y
-=
x-=y
x=x-y
*=
x*=y
x=x*y
/=
x/=y
x=x/y
%=
x%=y
x=x%y
The + Operator Used on Strings
The + operator can also be used to add string variables or text values together. To add two or
more string variables together, use the + operator. For example:
txt1="What a very";
txt2="nice day";
txt3=txt1+txt2;
After the execution of the statements above, the variable txt3 contains "What a very nice day".
JavaScript Comparison and Logical Operators
Comparison Operators
Comparison operators are used in logical statements to determine equality or difference
between variables or values. Given that x=5, the table below explains the comparison operators:
Operator
Description
Example
==
is equal to
x==8 is false
===
is exactly equal to (value and type)
x===5
is
x==="5" is false
!=
is not equal
x!=8 is true
>
is greater than
x>8 is false
<
is less than
x<8 is true
>=
is greater than or equal to
x>=8 is false
<=
is less than or equal to
x<=8 is true
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
true
Comparison operators can be used in conditional statements to compare values and take
action depending on the result. For example:
if (age<18) document.write("Too young");
Logical Operators
Logical operators are used to determine the logic between variables or values.
Given that x=6 and y=3, the table below explains the logical operators:
Operator
Description
Example
&&
and
(x < 10 && y > 1) is true
||
or
(x==5 || y==5) is false
!
not
!(x==y) is true
Conditional Operator
JavaScript also contains a conditional operator that assigns a value to a variable based on some
condition.
Syntax
variablename= (condition)?value1:value2
Example
greeting=(visitor=="PRES")?"Dear President ":"Dear ";
If the variable visitor has the value of "PRES", then the variable greeting will be assigned the
value "Dear President " else it will be assigned "Dear".
JavaScript If...Else Statements
Conditional Statements
Conditional statements are used to perform different actions based on different conditions.
In JavaScript we have the following conditional statements:
• if statement - use this statement to execute some code only if a specified condition is true
• if...else statement - use this statement to execute some code if the condition is true and
another code if the condition is false
• if...else if....else statement - use this statement to select one of many blocks of code to be
executed
• switch statement - use this statement to select one of many blocks of code to be executed
If Statement
Use the if statement to execute some code only if a specified condition is true.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Syntax:
if (condition)
{
code to be executed if condition is true
}
Example:
<HTML>
<BODY>
<SCRIPT TYPE="text/javascript">
var d = new Date();
var time = d.getHours();
if (time > 10)
{
document.write("<b>Good morning</b>");
}
</SCRIPT>
<P>This example demonstrates the If statement.</P>
<P>If the time on your browser is less than 10, you will get a "Good morning"
greeting.</P>
</BODY>
</HTML>
Result is shown below:
If...else if...else Statement
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Use the if....else if...else statement to select one of several blocks of code to be executed.
Syntax:
if (condition1)
{
code to be executed if condition1 is true
}
else if (condition2)
{
code to be executed if condition2 is true
}
else
{
code to be executed if condition1 and condition2 are not true
}
Example:
<HTML>
<BODY>
<SCRIPT TYPE="text/javascript">
var d = new Date();
var time = d.getHours();
if (time<10)
{
document.write("<b>Good morning</b>");
}
else if (time>=10 && time<16)
{
document.write("<b>Good day</b>");
}
else
{
document.write("<b>Hello World!</b>");
}
</SCRIPT>
<P>
This example demonstrates the if..else if...else statement.
</P>
</BODY>
</HTML>
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
The result is shown below:
The JavaScript Switch Statement
Use the switch statement to select one of many blocks of code to be executed.
Syntax:
switch(n)
{
case 1:
execute code block 1
break;
case 2:
execute code block 2
break;
default:
code to be executed if n is different from case 1 and 2
}
Example:
<HTML>
<BODY>
<SCRIPT TYPE="text/javascript">
var d=new Date();
var theDay=d.getDay();
switch (theDay)
{
case 5:
document.write("<b>Finally Friday</b>");
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
break;
case 6:
document.write("<b>Super Saturday</b>");
break;
case 0:
document.write("<b>Sleepy Sunday</b>");
break;
default:
document.write("<b>I'm really looking forward to this
weekend!</b>");
}
</SCRIPT>
<P>This JavaScript will generate a different greeting based on what day it is. Note
that Sunday=0, Monday=1, Tuesday=2, etc.</P>
</BODY>
</HTML>
The result is shown in the figure below:
JavaScript Popup Boxes
JavaScript has three kinds of popup boxes: Alert box, Confirm box, and Prompt box.
Alert Box
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
An alert box is often used if you want to make sure information comes through to the user.
When an alert box pops up, the user will have to click "OK" to proceed.
Syntax
alert("sometext");
Example:
<HTML>
<HEAD>
<SCRIPT TYPE="text/javascript">
function show_alert()
{
alert("Hello! I am an alert box!");
}
</SCRIPT>
</HEAD>
<BODY>
<INPUT TYPE="button" onclick="show_alert()" VALUE="Show alert box" />
</BODY>
</HTML>
The result is shown in the following figure:
Confirm Box
A confirm box is often used if you want the user to verify or accept something.
When a confirm box pops up, the user will have to click either "OK" or "Cancel" to proceed.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
If the user clicks "OK", the box returns true. If the user clicks "Cancel", the box returns false.
Syntax:
confirm("sometext");
Example:
<HTML>
<HEAD>
<SCRIPT TYPE="text/javascript">
function show_confirm()
{
var r=confirm("Press a button!");
if (r==true)
{
alert("You pressed OK!");
}
else
{
alert("You pressed Cancel!");
}
}
</SCRIPT>
</HEAD>
<BODY>
<INPUT TYPE="button" onclick="show_confirm()" VALUE="Show a confirm
box" />
</BODY>
</HTML>
The result is shown below:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Prompt Box
A prompt box is often used if you want the user to input a value before entering a page.
When a prompt box pops up, the user will have to click either "OK" or "Cancel" to proceed after
entering an input value.
If the user clicks "OK" the box returns the input value. If the user clicks "Cancel" the box
returns null.
Syntax:
prompt("sometext","defaultvalue");
Example:
<HTML>
<HEAD>
<SCRIPT TYPE="text/javascript">
function show_prompt()
{
var name=prompt("Please enter your name","Harry Potter");
if (name!=null && name!="")
{
document.write("Hello " + name + "! How are you today?");
}
}
</SCRIPT>
</HEAD>
<BODY>
<INPUT TYPE="button" onclick="show_prompt()" value="Show prompt box" />
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
</BODY>
</HTML>
The result is shown in the following figure:
JavaScript Functions
To keep the browser from executing a script when the page loads, you can put your script
into a function. A function contains code that will be executed by an event or by a call to the
function. You may call a function from anywhere within a page (or even from other pages if the
function is embedded in an external .js file). Functions can be defined both in the <HEAD> and
in the <BODY> section of a document. However, to assure that a function is read/loaded by the
browser before it is called, it could be wise to put functions in the <HEAD> section.
How to Define a Function
Syntax:
function functionname(var1,var2,...,varX)
{
some code
}
The parameters var1, var2, etc. are variables or values passed into the function. The {and
the} defines the start and end of the function.
Example:
<HTML>
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
<HEAD>
<SCRIPT TYPE="text/javascript">
function displaymessage()
{
alert("Hello World!");
}
</SCRIPT>
</HEAD>
<BODY>
<FORM>
<INPUT TYPE="button" VALUE="Click me!" ONCLICK="displaymessage()"/>
</FORM>
</BODY>
</HTML>
Following figure shows the result:
JavaScript Loops
Often when you write code, you want the same block of code to run over and over again in
a row. Instead of adding several almost equal lines in a script we can use loops to perform a task
like this.
Loops execute a block of code a specified number of times, or while a specified condition
is true. In JavaScript, there are two different kinds of loops:
• for - loops through a block of code a specified number of times
• while - loops through a block of code while a specified condition is true
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
The for Loop
The for loop is used when you know in advance how many times the script should run.
Syntax
for (variable=startvalue;variable<=endvalue;variable=variable+increment)
{
code to be executed
}
Example
The example below defines a loop that starts with i=0. The loop will continue to run as
long as i is less than, or equal to 5. i will increase by 1 each time the loop runs.
<HTML>
<BODY>
<SCRIPT TYPE="text/javascript">
for (i = 0; i <= 5; i++)
{
document.write("The number is " + i);
document.write("<br />");
}
</SCRIPT>
<P>Explanation:</P>
<P>This for loop starts with i=0.</P>
<P>As long as <B>i</B> is less than, or equal to 5, the loop will continue to run.</P>
<P><B>i</B> will increase by 1 each time the loop runs.</P>
</BODY>
</HTML>
Following figure shows the result:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
The while Loop
The while loop loops through a block of code while a specified condition is true.
Syntax:
while (variable<=endvalue)
{
code to be executed
}
Example:
The example below defines a loop that starts with i=0. The loop will continue to run as long
as i is less than, or equal to 5. i will increase by 1 each time the loop runs:
<HTML>
<BODY>
<SCRIPT TYPE="text/javascript">
i=0;
while (i<=5)
{
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
document.write("The number is " + i);
document.write("<br />");
i++;
}
</SCRIPT>
</BODY>
</HTML>
Result:
The do...while Loop
The do...while loop is a variant of the while loop. This loop will execute the block of code
ONCE, and then it will repeat the loop as long as the specified condition is true.
Syntax:
do
{
code to be executed
}
while (variable<=endvalue);
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Example:
The example below uses a do...while loop. The do...while loop will always be executed at
least once, even if the condition is false, because the statements are executed before the condition
is tested:
<HTML>
<BODY>
<SCRIPT TYPE="text/javascript">
i = 0;
do
{
document.write("The number is " + i);
document.write("<br />");
i++;
}
while (i <= 5)
</SCRIPT>
</BODY>
</HTML>
Result:
The break Statement
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
The break statement will break the loop and continue executing the code that follows after
the loop (if any).
Example:
<HTML>
<BODY>
<SCRIPT TYPE="text/javascript">
var i=0;
for (i=0;i<=10;i++)
{
if (i==3)
{
break;
}
document.write("The number is " + i);
document.write("<br />");
}
</SCRIPT>
<P>Explanation: The loop will break when i=3.</P>
</BODY>
</HTML>
Result:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
The continue Statement
The continue statement will break the current loop and continue with the next value.
Example:
<HTML>
<BODY>
<SCRIPT TYPE="text/javascript">
var i=0
for (i=0;i<=10;i++)
{
if (i==3)
{
continue;
}
document.write("The number is " + i);
document.write("<br />");
}
</SCRIPT>
</BODY>
</HTML>
Result:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Client-Side Programming in JavaScript
Using JavaScript and forms
Creating the form
There are few differences between a straight HTML form and a JavaScript-enhanced form.
The main one being that a JavaScript form relies on one or more event handlers, such as onClick
or onSubmit. These invoke a JavaScript action when the user does something in the form, like
clicking a button. The event handlers, which are placed with the rest of the attributes in the
HTML form tags, are invisible to a browser that does not support JavaScript. Because of this
trait, you can often use one form for both JavaScript and non-JavaScript browsers.
Typical form control objects -- also called "widgets" -- include the following:
• Text box for entering a line of text
• Push button for selecting an action
• Radio buttons for making one selection among a group of options
• Check boxes for selecting or deselecting a single, independent option
For example:
<FORM NAME="myform" ACTION="" METHOD="GET">
Enter something in the box: <BR>
<INPUT TYPE="text" NAME="inputbox" VALUE=""><P>
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
<INPUT
TYPE="button"
onClick="testResults(this.form)">
</FORM>
NAME="button"
Value="Click"
•
FORM NAME="myform" defines and names the form. Elsewhere in the JavaScript
you can reference this form by the name myform. The name you give your form is up to
you, but it should comply with JavaScript's standard variable/function naming rules (no
spaces, no weird characters except the underscore, etc.).
• ACTION="" defines how you want the browser to handle the form when it is submitted
to a CGI program running on the server. As this example is not designed to submit
anything, the URL for the CGI program is omitted.
• METHOD="GET" defines the method data is passed to the server when the form is
submitted. In this case the attribute is puffer as the example form does not submit
anything.
• INPUT TYPE="text" defines the text box object. This is standard HTML markup.
• INPUT TYPE="button" defines the button object. This is standard HTML markup
except for the onClick handler.
• onClick="testResults(this.form)" is an event handler -- it handles an event, in this case
clicking the button. When the button is clicked, JavaScript executes the expression within
the quotes. The expression says to call the testResults function elsewhere on the page,
and pass to it the current form object.
Getting a value from a form object
Here's the full script you can try as you experiment with obtaining values from form
objects. Load the page, then type something into the text box. Click the button, and what you
typed is shown in the alert box.
<HTML>
<HEAD>
<TITLE>Test Input</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function testResults (form) {
var TestVar = form.inputbox.value;
alert ("You typed: " + TestVar);
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="myform" ACTION="" METHOD="GET">Enter something in the
box: <BR>
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
<INPUT TYPE="text" NAME="inputbox" VALUE=""><P>
<INPUT
TYPE="button"
NAME="button"
onClick="testResults(this.form)">
</FORM>
</BODY>
</HTML>
Value="Click"
The following figure shows the result of the above script:
Here's how the script works. JavaScript calls the testResults function when you click the
button in the form. The testResults function is passed to the form object using the
syntax this.form (the this keyword references the button control; form is a property of the button
control and represents the form object). I've given the form object the name form inside the
testResult function, but you can any name you like.
The testResults function is simple -- it merely copies the contents of the text box to a
variable named TestVar. Notice how the text box contents were referenced. I defined the form
object I wanted to use (called form), the object within the form that I wanted (called inputbox),
and the property of that object I wanted (the value property).
Setting a value in a form object
The value property of the input box, shown in the above example, is both readable and
writable. That is, you can read whatever is typed into the box, and you can write data back into
it. The process of setting the value in a form object is just the reverse of reading it. Here's a short
example to demonstrate setting a value in a form text box. The process is similar to the previous
example, except this time there are two buttons. Click the "Read" button and the script reads
what you typed into the text box. Click the "Write" button and the script writes a particularly
lurid phrase into the text box.
set_formval.html
<HTML>
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
<HEAD>
<TITLE>Test Input </TITLE>
<SCRIPT LANGUAGE="JavaScript">
function readText (form) {
TestVar =form.inputbox.value;
alert ("You typed: " + TestVar);
}
function writeText (form) {
form.inputbox.value = "Have a nice day!"
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="myform" ACTION="" METHOD="GET">
Enter something in the box: <BR>
<INPUT TYPE="text" NAME="inputbox" VALUE=""><P>
<INPUT
TYPE="button"
NAME="button1"
onClick="readText(this.form)">
<INPUT
TYPE="button"
NAME="button2"
onClick="writeText(this.form)">
</FORM>
</BODY>
</HTML>
The result is shown in the figure below:
•
•
Value="Read"
Value="Write"
When you click the "Read" button, JavaScript calls the readText function, which reads
and displays the value you entered into the text box.
When you click the "Write" button, JavaScript calls the writeText function, which
writes "Have a nice day!" in the text box.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Reading other form object values
The text box is perhaps the most common form object you'll read (or write) using
JavaScript. However, you can use JavaScript to read and write values from most other objects
(note that JavaScript cannot currently be used to read or write data using the password text box).
In addition to text boxes, JavaScript can be used with:
• Hidden text box (TYPE="hidden").
• Radio button (TYPE="radio")
• Check box (TYPE="checkbox")
• Text area (<TEXT AREA>)
• Lists (<SELECT>)
Using Hidden Text Boxes
From a JavaScript standpoint, hidden text boxes behave just like regular text boxes, sharing
the same properties and methods. From a user standpoint, hidden text boxes "don't exist"
because they do not appear in the form. Rather, hidden text boxes are the means by which special
information can be passed between server and client. They can also be used to hold temporary
data that you might want to use later. Because hidden text boxes are used like standard text boxes
a separate example won't be provided here.
Using Radio Buttons
Radio buttons are used to allow the user to select one, and only one, item from a group of
options. Radio buttons are always used in multiples; there is no logical sense in having just one
radio button on a form, because once you click on it, you can't unclick it. If you want a simple
click/unclick choice use a check box instead.
To define radio buttons for JavaScript, provide each object with the same name. JavaScript
will create an array using the name you've provided; you then reference the buttons using the
array indexes. The first button in the series is numbered 0, the second is numbered 1, and so
forth. Note that the VALUE attribute is optional for JavaScript-only forms. You'll want to
provide a value if you submit the form to a CGI program running on the server, however.
<INPUT TYPE="radio" NAME="rad" VALUE="radio_button1" onClick=0>
<INPUT TYPE="radio" NAME="rad" VALUE="radio_button2" onClick=0>
<INPUT TYPE="radio" NAME="rad" VALUE="radio_button3" onClick=0>
<INPUT TYPE="radio" NAME="rad" VALUE="radio_button4" onClick=0>
Following is an example of testing which button is selected. The for loop in the testButton
function cycles through all of the buttons in the "rad" group. When it finds the button that's
selected, it breaks out of the loop and displays the button number (remember: starting from 0).
form_radio.html
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
<HTML>
<HEAD>
<TITLE>Radio Button Test</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function testButton (form){
for (Count = 0; Count < 3; Count++) {
if (form.rad[Count].checked)
break;
}
alert ("Button " + Count + " is selected");
}
</SCRIPT>
</HEAD>
<FORM NAME="testform">
<INPUT TYPE="button" NAME="button" Value="Click"
onClick="testButton(this.form)"> <BR>
<INPUT TYPE="radio" NAME="rad" Value="rad_button1" onClick=0><BR>
<INPUT TYPE="radio" NAME="rad" Value="rad_button2" onClick=0><BR>
<INPUT TYPE="radio" NAME="rad" Value="rad_button3" onClick=0><BR>
</FORM>
</HTML>
Result:
Setting a radio button selection with HTML is simple. If you want the form to initially
appear with a given radio button selected, add the CHECKED attribute to the HTML markup for
that button:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
<INPUT TYPE="radio" NAME="rad" Value="rad_button1" CHECKED onClick=0>
You can also set the button selection programmatically with JavaScript, using the checked
property. Specify the index of the radio button array you want to checked.
form.rad[0].checked = true; // sets to first button in the rad group
Using Check Boxes
Check boxes are stand-alone elements; that is, they don't interact with neighboring
elements like radio buttons do. Therefore they are a bit easier to use. Using JavaScript you can
test if a check box is checked using the checked property, as shown here. Likewise, you can set
the checked property to add or remove the checkmark from a check box. In this example an alert
message tells you if the first check box is checked. The value is true if the box is checked; false
if it is not.
form_check.html
<HTML>
<HEAD>
<TITLE>Checkbox Test</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function testButton (form){
alert (form.check1.checked);
}
</SCRIPT>
</BODY>
<FORM NAME="testform">
<INPUT TYPE="button" NAME="button" Value="Click"
onClick="testButton(this.form)"><BR>
<INPUT TYPE="checkbox" NAME="check1" Value="Check1">Checkbox1 <BR>
<INPUT TYPE="checkbox" NAME="check2" Value="Check2">Checkbox2> <BR>
<INPUT TYPE="checkbox" NAME="check3" Value="Check3">Checkbox3
<BR>
</FORM>
</BODY>
</HTML>
Result:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
As with the radio button object, add a CHECKED attribute to the HTML markup for that
check box you wish to be initially checked when the form is first loaded.
<INPUT TYPE="checkbox" NAME="check1" Value="0" CHECKED>Checkbox 1>
You can also set the button selection programmatically with JavaScript, using the checked
property. Specify the name of the checkbox you want to check, as in
form.check1.checked = true;
Using Text Areas
Text areas are used for multiple-line text entry. The default size of the text box is 1 row by
20 characters. You can change the size using the COLS and ROWS attributes. Here's a typical
example of a text area with a text box 40 characters wide by 7 rows:
<TEXTAREA NAME="myarea" COLS="40" ROWS="7">
</TEXTAREA>
You can use JavaScript to read the contents of the text area box. This is done with the value
property. Here is an example:
form_textarea.html
<HTML>
<HEAD>
<TITLE>Text Area Test</TITLE>
<SCRIPT LANGUAGE="JavaScript">
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
function seeTextArea (form) {
alert (form.myarea.value);
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="myform">
<INPUT TYPE="button" NAME="button3" Value="Test"
onClick="seeTextArea(this.form)">
<TEXTAREA NAME="myarea" COLS="40" ROWS="5">
</TEXTAREA>
</FORM>
</BODY>
</HTML>
Result:
You can preload text into the text area in either of two ways. One method is to enclose text
between the <TEXTAREA> and </TEXTAREA> tags. This method is useful if you wish to
include hard returns, as these are retained in the text area box. Or, you can set it
programmatically with JavaScript using the following syntax:
form.textarea.value = "Text goes here";
• form is the name of the form.
• textarea is the name of the text area.
• "Text goes here" is the text you want to display
Using Selection Lists
List boxes let you pick the item you want out of a multiple-choice box. The listbox itself is
created with the <SELECT> tag, and the items inside it are created by one or more <OPTION>
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
tags. You can have any number of <OPTION> tags in a list. The list is terminated with a
</SELECT> tag.
The list can appear with many items showing at once, or it can appear in a drop-down box - normally you see one item at a time, but click to see more. The markup for the two styles is
identical, except for the optional SIZE attribute. Leave off SIZE to make a drop-down box; use
SIZE to make a list box of the size you wish.
Use the selectedIndex property to test which option item is selected in the list, as shown
in the following example. The item is returned as an index value, with 0 being the first option, 1
being the second, and so forth (if no item is selected the value is -1).
form_select.html
<HTML>
<HEAD>
<TITLE>List Box Test</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function testSelect(form) {
alert (form.list.selectedIndex);
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="myform" ACTION="" METHOD="GET">
<INPUT
TYPE="button"
NAME="button"
Value="Test"
onClick="testSelect(this.form)">
<SELECT NAME="list" SIZE="3">
<OPTION>This is item 1
<OPTION>This is item 2
<OPTION>This is item 3
</SELECT>
</FORM>
</BODY>
</HTML>
Result:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
If you want the text of the selected list item instead of the index, use this in the testSelect
function:
function testSelect (form) {
Item = form.list.selectedIndex;
Result = form.list.options[Item].text;
alert (Result);
}
Other events you can trigger within a form
I've used the onClick event handler in all of the examples because that's the one you are
most likely to deal with in your forms. Yet JavaScript supports a number of other event handlers
as well. Use these as the need arises, and the mood fits. In Navigator 2.x The event handlers used
with form object are:
• onFocus -- an event is triggered with a form object gets input focus (the insertion point
is clicked there).
• onBlur -- an event is triggered with a form object loses input focus (the insertion point
is clicked out of there).
• onChange -- an event is triggered when a new item is selected in a list box. This event
is also trigged with a text or text area box loses focus and the contents of the box has
changed.
• onSelect -- an event is triggered when text in a text or text area box is selected.
• onSubmit -- an event is triggered when the form is submitted to the server (more about
this important hander later in the column).
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Submitting the form to the server
In the examples above I've limited the action of the form to within JavaScript only. Many
forms are designed to send data back to a CGI program running on the server. This is referred to
as submitting the form, and is accomplished using either of two JavaScript instructions: the
onSubmit event handler or the submit method. In most instances, you use one or the other, not
both!
• Place the onSubmit event hander in the <FORM> tag. This tells JavaScript what it
should do when the user clicks the Submit button (this is a button defined as
TYPE="submit").
• Place the submit instruction anywhere in your JavaScript. It can be activated by any
action, such as clicking a form button that has been defined with the onClick event
handler.
Using onSubmit
Here's an example of using the onSubmit event handler to send mail. The onSubmit event
handler tells JavaScript what to do when the user clicks the Submit button: call the mailMe()
function, where additional mail fields are appended to a mailto: URL. Navigator automatically
opens a new mail window with the fields filled in. Write the body of the message, and send the
mail off to the recipient.
onsubmit.html
<HTML>
<HEAD>
<TITLE>onSubmit Test</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function mailMe(form){
Subject=document.testform.inputbox1.value;
CC= document.testform.inputbox2.value;
BCC= document.testform.inputbox3.value;
location = "mailto:[email protected]?subject="+Subject+"&Bcc="+
BCC+"&cc="+CC;
return true;
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="testform" onSubmit="return mailMe(this.form)" >Subject of message: <BR>
<INPUT TYPE="text" NAME="inputbox1" VALUE="This is such a great form!" SIZE=50>
<P>Send cc to: <BR>
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
<INPUT TYPE="text" NAME="inputbox2" VALUE="" SIZE=50><P>
Send blind cc to: <BR>
<INPUT TYPE="text" NAME="inputbox3" VALUE="" SIZE=50><P>
<INPUT TYPE="submit"><BR>
</FORM>
</BODY>
</HTML>
Using submit
In the next example the submit method is used instead. The script is little changed, except
that the onSubmit handler is removed, and an onClick hander for a renamed form button is added
in its place. The submit() method replaces the return true statement in the previous example.
submit.html
<HTML>
<HEAD>
<TITLE>test</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function mailMe(form){
Subject=document.testform.inputbox1.value
CC= document.testform.inputbox2.value
BCC= document.testform.inputbox3.value
location
=
"/javaworld/cgi-bin/[email protected]?subject="+Subject+"&Bcc="+
BCC+"&cc="+CC
document.testform.submit();
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="testform">
Subject of message: <BR>
<INPUT TYPE="text" NAME="inputbox1" VALUE="This is such a great form!"
SIZE=50><P>
Send cc to: <BR><INPUT TYPE="text" NAME="inputbox2" VALUE="" SIZE=50><P>
Send blind cc to: <BR><INPUT TYPE="text" NAME="inputbox3" VALUE="" SIZE=50><P>
<INPUT TYPE="button" VALUE="Send Mail" onClick="mailMe()"><BR>
</FORM>
</BODY>
</HTML>
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Server-Side Programming in JavaScript
What is Server-side Scripting?
Normally when a browser requests an HTML file, the server returns the file, but if the file
contains a server-side script, the script inside the HTML file is executed by the server before the
file is returned to the browser as plain HTML.
What is Server-side Scripting?
Normally when a browser requests an HTML file, the server returns the file, but if the file
contains a server-side script, the script inside the HTML file is executed by the server before the
file is returned to the browser as plain HTML.
Server-side JavaScript (SSJS) refers to JavaScript that runs on server-side and is therefore not
downloaded to the browser. This term is used to differentiate it from regular JavaScript, which is
predominantly used on the client-side (also referred to as client-side JavaScript or CSJS for
short). The first implementation of SSJS was Netscape's LiveWire, which was included in their
Enterprise Server 2.0 back in 1996. Since then, a number of other companies have followed suit
in offering an alternative to the usual server-side technologies. One of the biggest players in the
field was Microsoft. They supported the use of JavaScript on the server within what is now
known as "classic" ASP. Along with the most common VBScript language, it also supported
JavaScript and PerlScript. In reality, Microsoft utilized JScript, their own version of JavaScript.
To use JScript/JavaScript, all you had to do was set the LANGUAGE attribute in the opening
script tag:
<%@LANGUAGE="JavaScript"%>
<%
Response.Write("<HTML>\r")
Response.Write("<FONT COLOR=\"red\">\"Hello World\"</FONT><BR>\r")
Response.Write("</HTML>\r")
%>
Since the code runs on the server, what is sent to the client is the output of the script rather
than the source code. Hence only the tags produced by the Response.Write() functions are found
in the page source:
<HTML>
<FONT COLOR="red">"Hello World"</FONT><BR>
</HTML>
In addition to alleviating development complexity, server-side JavaScript offers a few other
benefits that you may not have considered:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
•
•
The same code can validate data on both the client (for immediate user feedback) and on
the server (for security), so validations never get out of sync.
The same code can prepare both the HTML DOM server side and modify it client-side,
when the user changes the data or it's refreshed from the server.
Using the same code on both the client and the server, developers have fewer
technologies to learn and stay on top of, and fewer parts of the application or site to
maintain.
On the server, you also embed JavaScript in HTML pages. The server-side statements can
connect to relational databases from different vendors, share information across users of an
application, access the file system on the server, or communicate with other applications through
LiveConnect and Java. HTML pages with server-side JavaScript can also include client-side
JavaScript.
In contrast to pure client-side JavaScript pages, HTML pages that use server-side JavaScript
are compiled into bytecode executable files. These application executables are run by a web
server that contains the JavaScript runtime engine. For this reason, creating JavaScript
applications is a two-stage process.
In the first stage, shown in Figure, you create HTML pages (which can contain both clientside and server-side JavaScript statements) and JavaScript files. You then compile all of those
files into a single executable.
Server-side JavaScript during development
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
In the second stage, shown in Figure, a page in the application is requested by a client
browser. The runtime engine uses the application executable to look up the source page and
dynamically generate the HTML page to return. It runs any server-side JavaScript statements
found on the page. The result of those statements might add new HTML or client-side JavaScript
statements to the HTML page. The run-time engine then sends the resulting page over the
network to the Navigator client, which runs any client-side JavaScript and displays the results.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Server-side JavaScript during runtime
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
In contrast to standard Common Gateway Interface (CGI) programs, all JavaScript source
is integrated directly into HTML pages, facilitating rapid development and easy maintenance.
Server-side JavaScript's Session Management Service contains objects you can use to maintain
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
data that persists across client requests, multiple clients, and multiple applications. Server-side
JavaScript's LiveWire Database Service provides objects for database access that serve as an
interface to Structured Query Language (SQL) database servers.
Forms and Data in JavaScript
Validating form data using JavaScript
Form Validation – Checking for Non-Empty
This has to be the most common type of form validation. You want to be sure that your
visitors enter data into the HTML fields you have "required" for a valid submission. Below is the
JavaScript code to perform this basic check to see if a given HTML input is empty or not.
JavaScript Code:
// If the length of the element's string is 0 then display helper message
function notEmpty(elem, helperMsg){
if(elem.value.length == 0){
alert(helperMsg);
elem.focus(); // set the focus to this input
return false;
}
return true;
}
The function notEmpty will check to see that the HTML input that we send it has something
in it. elem is a HTML text input that we send to this function. JavaScript strings have built in
properties, one of which is the length property which returns the length of the string. The chunk
of code elem.value will grab the string inside the input and by adding on
length elem.value.length we can see how long the string is.
As long as elem.value.length isn't 0 then it's not empty and we return true, otherwise we
send an alert to the user with a helperMsg to inform them of their error and return false.
Working Example:
<SCRIPT TYPE='text/javascript'>
function notEmpty(elem, helperMsg){
if(elem.value.length == 0){
alert(helperMsg);
elem.focus();
return false;
}
return true;
}
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
</SCRIPT>
<FORM>
Required Field: <input type='text' id='req1'/>
<INPUT TYPE='button'
onclick="notEmpty(document.getElementById('req1'), 'Please Enter a Value')"
VALUE='Check Field' />
</FORM>
Result:
Form Validation – Checking for All Numbers
If someone is entering a credit card, phone number, zip code, similar information you want
to be able to ensure that the input is all numbers. The quickest way to check if an input's string
value is all numbers is to use a regular expression /^[0-9]+$/ that will only match if the string is
all numbers and is at least one character long.
JavaScript Code:
// If the element's string matches the regular expression it is all numbers
function isNumeric(elem, helperMsg){
var numericExpression = /^[0-9]+$/;
if(elem.value.match(numericExpression)){
return true;
}else{
alert(helperMsg);
elem.focus();
return false;
}
}
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
What we're doing here is using JavaScript existing framework to have it do all the hard
work for us. Inside each string is a function called match that you can use to see if the string
matches a certain regular expression. We accessed this function like so:
elem.value.match(expressionhere).
We wanted to see if the input's string was all numbers so we made a regular expression to check
for numbers [0-9] and stored it as numericExpression.
We then used the match function with our regular expression. If it is numeric then match will
return true, making our if statement pass the test and our function isNumeric will also return
true. However, if the expression fails because there is a letter or other character in our input's
string then we'll display our helperMsg and return false.
Working Example:
<SCRIPT TYPE='text/javascript'>
function isNumeric(elem, helperMsg){
var numericExpression = /^[0-9]+$/;
if(elem.value.match(numericExpression)){
return true;
}else
{
alert(helperMsg);
elem.focus();
return false;
}
}
</SCRIPT>
<FORM>
Numbers Only: <INPUT TYPE='text' id='numbers'/>
<INPUT TYPE='button'
onclick="isNumeric(document.getElementById('numbers'), 'Numbers Only Please')"
value='Check Field' />
</FORM>
Result:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Form Validation – Checking for All Letters
This function will be identical to isNumeric except for the change to the regular expression
we use inside the match function. Instead of checking for numbers we will want to check for all
letters. If we wanted to see if a string contained only letters we need to specify an expression that
allows for both lowercase and uppercase letters: /^[a-zA-Z]+$/ .
Example:
<SCRIPT TYPE='text/javascript'>
function isAlphabet(elem, helperMsg){
var alphaExp = /^[a-zA-Z]+$/;
if(elem.value.match(alphaExp)){
return true;
}else{
alert(helperMsg);
elem.focus();
return false;
}
}
</SCRIPT>
<FORM>
Letters Only: <INPUT TYPE='text' id='letters'/>
<INPUT TYPE='button'
onclick="isAlphabet(document.getElementById('letters'), 'Letters Only Please')"
value='Check Field' />
</FORM>
Result:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Form Validation – Checking for Numbers and Letters
By combining both the isAlphabet and isNumeric functions into one we can check to see
if a text input contains only letters and numbers.
JavaScript Code:
// If the element's string matches the regular expression it is numbers and letters
function isAlphanumeric(elem, helperMsg){
var alphaExp = /^[0-9a-zA-Z]+$/;
if(elem.value.match(alphaExp)){
return true;
}
else
{
alert(helperMsg);
elem.focus();
return false;
}
}
Form Validation – Restricting the Length
Being able to restrict the number of characters a user can enter into a field is one of the best
ways to prevent bad data. For example, if you know that the zip code field should only be 5
numbers you know that 2 numbers is not sufficient.
Below we have created a lengthRestriction function that takes a text field and two
numbers. The first number is the minimum number of characters and the second is the maximum
number of characters the input can be. If you just want to specify an exact number then send the
same number for both minimum and maximum.
JavaScript Code:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
function lengthRestriction(elem, min, max){
var uInput = elem.value;
if(uInput.length >= min && uInput.length <= max){
return true;
}
else
{
alert("Please enter between " +min+ " and " +max+ " characters");
elem.focus();
return false;
}
}
Here's an example of this function for a field that requires 6 to 8 characters for a valid username.
Example:
<SCRIPT TYPE='text/javascript'>
function lengthRestriction(elem, min, max){
var uInput = elem.value;
if(uInput.length >= min && uInput.length <= max){
return true;
}else{
alert("Please enter between " +min+ " and " +max+ " characters");
elem.focus();
return false;
}
}
</SCRIPT>
<FORM>
Username(6-8 characters): <INPUT TYPE='text' id='restrict'/>
<INPUT TYPE='button'
onclick="lengthRestriction(document.getElementById('restrict'), 6, 8)"
value='Check Field' />
</FORM>
Result:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Form Validation – Selection Made
To be sure that someone has actually selected a choice from an HTML select input you can
use a simple trick of making the first option as helpful prompt to the user and a red flag to you
for your validation code.
By making the first option of your select input something like "Please Choose" you can
spur the user to both make a selection and allow you to check to see if the default option "Please
Choose" is still selected when the submit the form.
JavaScript Code:
function madeSelection(elem, helperMsg){
if(elem.value == "Please Choose"){
alert(helperMsg);
elem.focus();
return false;
}
else
{
return true;
}
}
Working Example:
<script type='text/javascript'>
function madeSelection(elem, helperMsg){
if(elem.value == "Please Choose"){
alert(helperMsg);
elem.focus();
return false;
}else{
return true;
}
}
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
</script>
<form>
Selection: <select id='selection'>
<option>Please Choose</option>
<option>CA</option>
<option>WI</option>
<option>XX</option>
</select>
<input type='button'
onclick="madeSelection(document.getElementById('selection'),
Something')"
value='Check Field' />
</form>
Result:
'Please
Choose
Form Validation – Email Validation
Every email is made up for 5 parts:
1. A combination of letters, numbers, periods, hyphens, plus signs, and/or underscores
2. The at symbol @
3. A combination of letters, numbers, hyphens, and/or periods
4. A period
5. The top level domain (com, net, org, us, gov, ...)
Valid Examples:
• [email protected][email protected][email protected]
Invalid Examples:
• @deleted.net - no characters before the @
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
•
[email protected] - invalid character !
shoes@need_shining.com - underscores are not allowed in the domain name
The regular expression to check for all of this is a little overkill and beyond the scope of
this tutorial to explain thoroughly. However, test it out and you'll see that it gets the job done.
JavaScript Code:
function emailValidator(elem, helperMsg){
var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
if(elem.value.match(emailExp)){
return true;
}
else
{
alert(helperMsg);
elem.focus();
return false;
}
}
Working Example:
<SCRIPT TYPE='text/javascript'>
function emailValidator(elem, helperMsg){
var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
if(elem.value.match(emailExp)){
return true;
}else{
alert(helperMsg);
elem.focus();
return false;
}
}
</SCRIPT>
<FORM>
Email: <INPUT TYPE='text' id='emailer'/>
<INPUT TYPE='button'
onclick="emailValidator1(document.getElementById('emailer'), 'Not a Valid Email')"
value='Check Field' />
</FORM>
Result:
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Validating form data using JavaScript
If you've made it this far I commend you, but we're not done yet! The final step is to be
able to perform all of these validation steps when the user is ready to submit their data.
Each form has a JavaScript event called onSubmit that is triggered when its submit button
is clicked. If this even returns 0 or false then a form cannot be submitted, and if it returns 1 or
true it will always be submitted. Wouldn't it be perfect if we could somehow make an if
statement that said "If the form is valid submit it (1) else don't submit it (0)"? Well with a
master formValidator function we can do just that.
formValidator will be somewhat like a list of checks that we want to do before a form is
submitted. But before we can decide what we want to check for, we need to have our form!
HTML Form Code:
<form onsubmit='return formValidator()' >
First Name: <input type='text' id='firstname' /><br />
Address: <input type='text' id='addr' /><br />
Zip Code: <input type='text' id='zip' /><br />
State: <select id='state'>
<option>Please Choose</option>
<option>AL</option>
<option>CA</option>
<option>TX</option>
<option>WI</option>
</select><br />
Username(6-8 characters): <input type='text' id='username' /><br />
Email: <input type='text' id='email' /><br />
<input type='submit' value='Check Form' /><br />
</form>
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
That's a lot of data to verify and the first thing we would probably want to check is that
each field was at least filled out. To check for completion we will ensure no fields are empty and
that the SELECT field has a selection. Here are the starting pieces of our master validation
function formValidator.
JavaScript Code:
function formValidator(){
// Make quick references to our fields
var firstname = document.getElementById('firstname');
var addr = document.getElementById('addr');
var zip = document.getElementById('zip');
var state = document.getElementById('state');
var username = document.getElementById('username');
var email = document.getElementById('email');
// Check each input in the order that it appears in the form!
if(isAlphabet(firstname, "Please enter only letters for your name")){
if(isAlphanumeric(addr, "Numbers and Letters Only for Address")){
if(isNumeric(zip, "Please enter a valid zip code")){
if(madeSelection(state, "Please Choose a State")){
if(lengthRestriction(username, 6, 8)){
if(emailValidator(email, "Please enter a valid email
address")){
return true;
}
}
}
}
}
}
return false;
}
The first part of this function is where we create easy references to our HTML inputs using
the getElementById function. These quick references will make our next block of code much
easier to read!
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
The second part uses a bunch of embedded if statements to see whether or not each field
has the correct type of data. If every single one of those fields we check validates, then we'll
return true and the form will be submitted successfully.
However, if just one of those if statements fails then the return false at the end of the
function is reached and prevents the form for being submitted.
As you can see this function really does do quite a lot, definitely earning the title
of formValidator..
Now let's put all the necessary and HTML together and try it out!
All Together Now
HTML & JavaScript Code:
<SCRIPT TYPE='text/javascript'>
function formValidator(){
// Make quick references to our fields
var firstname = document.getElementById('firstname');
var addr = document.getElementById('addr');
var zip = document.getElementById('zip');
var state = document.getElementById('state');
var username = document.getElementById('username');
var email = document.getElementById('email');
// Check each input in the order that it appears in the form!
if(isAlphabet(firstname, "Please enter only letters for your name")){
if(isAlphanumeric(addr, "Numbers and Letters Only for Address")){
if(isNumeric(zip, "Please enter a valid zip code")){
if(madeSelection(state, "Please Choose a State")){
if(lengthRestriction(username, 6, 8)){
if(emailValidator(email, "Please enter a valid email
address")){
return true;
}
}
}
}
}
}
return false;
}
function notEmpty(elem, helperMsg){
if(elem.value.length == 0){
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
alert(helperMsg);
elem.focus(); // set the focus to this input
return false;
}
return true;
}
function isNumeric(elem, helperMsg){
var numericExpression = /^[0-9]+$/;
if(elem.value.match(numericExpression)){
return true;
}else{
alert(helperMsg);
elem.focus();
return false;
}
}
function isAlphabet(elem, helperMsg){
var alphaExp = /^[a-zA-Z]+$/;
if(elem.value.match(alphaExp)){
return true;
}else{
alert(helperMsg);
elem.focus();
return false;
}
}
function isAlphanumeric(elem, helperMsg){
var alphaExp = /^[0-9a-zA-Z]+$/;
if(elem.value.match(alphaExp)){
return true;
}else{
alert(helperMsg);
elem.focus();
return false;
}
}
function lengthRestriction(elem, min, max){
var uInput = elem.value;
if(uInput.length >= min && uInput.length <= max){
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
return true;
}else{
alert("Please enter between " +min+ " and " +max+ " characters");
elem.focus();
return false;
}
}
function madeSelection(elem, helperMsg){
if(elem.value == "Please Choose"){
alert(helperMsg);
elem.focus();
return false;
}else{
return true;
}
}
function emailValidator(elem, helperMsg){
var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
if(elem.value.match(emailExp)){
return true;
}else{
alert(helperMsg);
elem.focus();
return false;
}
}
</SCRIPT>
<FORM ONSUBMIT='return formValidator()' >
First Name: <INPUT TYPE='text' id='firstname' /><br />
Address: <INPUT TYPE='text' id='addr' /><br />
Zip Code: <INPUT TYPE='text' id='zip' /><br />
State: <SELECT id='state'>
<OPTION>Please Choose</OPTION>
<OPTION>AL</OPTION>
<OPTION>CA</OPTION>
<OPTION>TX</OPTION>
<OPTION>WI</OPTION>
</SELECT><BR />
Username(6-8 characters): <INPUT TYPE='text' id='username' /><BR />
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Email: <INPUT TYPE='text' id='email' /><BR />
<INPUT TYPE='submit' value='Check Form' />
</FORM>
Result:
XML Basics
What is XML?
• XML stands for EXtensible Markup Language
• XML is a markup language much like HTML
• XML was designed to carry data, not to display data
• XML tags are not predefined. You must define your own tags
• XML is designed to be self-descriptive
• XML is a W3C Recommendation
The Difference between XML and HTML
XML is not a replacement for HTML.
XML and HTML were designed with different goals:
• XML was designed to transport and store data, with focus on what data is
• HTML was designed to display data, with focus on how data looks
HTML is about displaying information, while XML is about carrying information.
With XML You Invent Your Own Tags
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
That is because the XML language has no predefined tags. The tags used in HTML are
predefined. HTML documents can only use tags defined in the HTML standard (like <p>, <h1>,
etc.). XML allows the author to define his/her own tags and his/her own document structure.
XML is Not a Replacement for HTML
XML is a complement to HTML.
It is important to understand that XML is not a replacement for HTML. In most web
applications, XML is used to transport data, while HTML is used to format and display the data.
XML Separates Data from HTML
If you need to display dynamic data in your HTML document, it will take a lot of work to
edit the HTML each time the data changes. With XML, data can be stored in separate XML files.
This way you can concentrate on using HTML for layout and display, and be sure that changes in
the underlying data will not require any changes to the HTML. With a few lines of JavaScript
code, you can read an external XML file and update the data content of your web page.
XML Simplifies Data Sharing
In the real world, computer systems and databases contain data in incompatible formats.
XML data is stored in plain text format. This provides a software- and hardware-independent
way of storing data. This makes it much easier to create data that can be shared by different
applications.
XML Simplifies Data Transport
One of the most time-consuming challenges for developers is to exchange data between
incompatible systems over the Internet. Exchanging data as XML greatly reduces this
complexity, since the data can be read by different incompatible applications.
XML Simplifies Platform Changes
Upgrading to new systems (hardware or software platforms), is always time consuming.
Large amounts of data must be converted and incompatible data is often lost. XML data is stored
in text format. This makes it easier to expand or upgrade to new operating systems, new
applications, or new browsers, without losing data.
XML Makes Your Data More Available
Different applications can access your data, not only in HTML pages, but also from XML
data sources. With XML, your data can be available to all kinds of "reading machines"
(Handheld computers, voice machines, news feeds, etc), and make it more available for blind
people, or people with other disabilities.
XML is Used to Create New Internet Languages
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
A lot of new Internet languages are created with XML.
Here are some examples:
• XHTML
• WSDL for describing available web services
• WAP and WML as markup languages for handheld devices
• RSS languages for news feeds
• RDF and OWL for describing resources and ontology
• SMIL for describing multimedia for the web
XML Documents Form a Tree Structure
XML documents must contain a root element. This element is "the parent" of all other
elements. The elements in an XML document form a document tree. The tree starts at the root
and branches to the lowest level of the tree.
All elements can have sub elements (child elements):
<root>
<child>
..</subchild>
<subchild>.....</subchild>
</child>
</root>
The terms parent, child, and sibling are used to describe the relationships between
elements. Parent elements have children. Children on the same level are called siblings (brothers
or sisters). All elements can have
ave text content and attributes (just like in HTML).
Example:
The image above represents one book in the XML below:
<bookstore>
<book category="COOKING">
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH
NH-71
71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail
mail : [email protected]
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="WEB">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
The root element in the example is <bookstore>. All <book> elements in the document are
contained within <bookstore>. The <book> element has 4 children: <title>,< author>, <year>,
<price>.
XML Syntax Rules
All XML Elements Must Have a Closing Tag
In HTML, elements do not have to have a closing tag:
<p>This is a paragraph
<p>This is another paragraph
In XML, it is illegal to omit the closing tag. All elements must have a closing tag:
<p>This is a paragraph</p>
<p>This is another paragraph</p>
XML Tags are Case Sensitive
XML tags are case sensitive. The tag <Letter> is different from the tag <letter>.
Opening and closing tags must be written with the same case:
<Message>This is incorrect</message>
<message>This is correct</message>
XML Elements Must be Properly Nested
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
In HTML, you might see improperly nested elements:
<b><i>This text is bold and italic</b></i>
In XML, all elements must be properly nested within each other:
<b><i>This text is bold and italic</i></b>
In the example above, "Properly nested" simply means that since the <i> element is opened
inside the <b> element, it must be closed inside the <b> element.
XML Documents Must Have a Root Element
XML documents must contain one element that is the parent of all other elements. This
element is called the root element.
XML Attribute Values must be Quoted
XML elements can have attributes in name/value pairs just like in HTML. In XML, the
attribute values must always be quoted. Study the two XML documents below. The first one is
incorrect, the second is correct:
<note date=12/11/2007>
<to>Tove</to>
<from>Jani</from>
</note>
<note date="12/11/2007">
<to>Tove</to>
<from>Jani</from>
</note>
The error in the first document is that the date attribute in the note element is not quoted.
Entity References
Some characters have a special meaning in XML. If you place a character like "<" inside an
XML element, it will generate an error because the parser interprets it as the start of a new
element. This will generate an XML error:
<message>if salary < 1000 then</message>
To avoid this error, replace the "<" character with an entity reference:
<message>if salary &lt; 1000 then</message>
There are 5 predefined entity references in XML:
&lt;
<
less than
&gt;
>
greater than
&amp;
&
ampersand
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
&apos;
'
apostrophe
&quot;
"
quotation mark
Comments in XML
The syntax for writing comments in XML is similar to that of HTML.
<!-- This is a comment -->
XML Stores New Line as LF
In Windows applications, a new line is normally stored as a pair of characters: carriage
return (CR) and line feed (LF). In Unix applications, a new line is normally stored as an LF
character. Macintosh applications also use an LF to store a new line. XML stores a new line as
LF.
XML Elements
An XML element is everything from (including) the element's start tag to (including) the
element's end tag.
An element can contain:
• other elements
• text
• attributes
• or a mix of all of the above...
<bookstore>
<book category="CHILDREN">
<title>Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="WEB">
<title>Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
In the example above, <bookstore> and <book> have element contents, because they
contain other elements. <book> also has an attribute (category="CHILDREN"). <title>,
<author>, <year>, and <price> have text content because they contain text.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
XML Naming Rules
XML elements must follow these naming rules:
• Names can contain letters, numbers, and other characters
• Names cannot start with a number or punctuation character
• Names cannot start with the letters xml (or XML, or Xml, etc)
• Names cannot contain spaces
Any name can be used, no words are reserved.
XML Attributes
In HTML, attributes provide additional information about elements:
<img src="computer.gif">
<a href="demo.asp">
Attributes often provide information that is not a part of the data. In the example below, the
file type is irrelevant to the data, but can be important to the software that wants to manipulate
the element:
<file type="gif">computer.gif</file>
XML Attributes Must be Quoted
Attribute values must always be quoted. Either single or double quotes can be used. For a
person's sex, the person element can be written like this:
<person sex="female">
or like this:
<person sex='female'>
If the attribute value itself contains double quotes you can use single quotes, like in this
example:
<gangster name='George "Shotgun" Ziegler'>
or you can use character entities:
<gangster name="George &quot;Shotgun&quot; Ziegler">
Introduction to Web Servers
A web server can be referred to as either the hardware (the computer) or the software (the
computer application) that helps to deliver content that can be accessed through the Internet. A
web server is what makes it possible to be able to access content like web pages or other data
from anywhere as long as it is connected to the internet. The hardware houses the content, while
the software makes the content accessible through the internet.
The most common use of web servers is to host websites but there are other uses like data
storage or for running enterprise applications. There are also different ways to request content
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
from a web server. The most common request is the Hypertext Transfer Protocol (HTTP), but
there are also other requests like the Internet Message Access Protocol (IMAP) or the File
Transfer Protocol (FTP).
How Web Servers Work
The Basic Process
Let's say that you are sitting at your computer, surfing the Web, and you get a call from a
friend who says, "I just read a great article! Type in this URL and check it out. It's at
http://www.howstuffworks.com/web-server.htm." So you type that URL into your browser and
press return. And magically, no matter where in the world that URL lives, the page pops up on
your screen.
At the most basic level possible, the following diagram shows the steps that brought that
page to your screen:
Your browser formed a connection to a Web server, requested a page and received it.
Behind the Scenes
If you want to get into a bit more detail on the process of getting a Web page onto your
computer screen, here are the basic steps that occurred behind the scenes:
• The browser broke the URL into three parts:
1. The protocol ("http")
2. The server name ("www.howstuffworks.com")
3. The file name ("web-server.htm")
• The browser communicated with a name server to translate the server name
"www.howstuffworks.com" into an IP Address, which it uses to connect to the server
machine.
• The browser then formed a connection to the server at that IP address on port 80.
Note: Any server machine makes its services available to the Internet using numbered ports,
one for each service that is available on the server. For example, if a server machine is
running a Web server and an FTP server, the Web server would typically be available on port
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
80, and the FTP server would be available on port 21. Clients connect to a service at a
specific IP address and on a specific port.
• Following the HTTP protocol, the browser sent a GET request to the server, asking for
the file "http://www.howstuffworks.com/web-server.htm."
• The server then sent the HTML text for the Web page to the browser.
• The browser reads the HTML tags and displays the page onto your screen.
Personal Web Server
PWS, an abbreviation for Personal Web Server, is Microsoft's version of a Web
server program for individual PC users who want to share Web pages and other files from their
hard drive. PWS is a scaled-down version of Microsoft's more robust Web server, Internet
Information Server IIS. PWS can be used with a full-time Internet connection to serve Web
pages for a Web site with limited traffic. It can also be used for testing a Web site offline or from
a "staging" site before putting it on a main Web site that is exposed to larger traffic.
PWS can be used together with Microsoft's FrontPage, a Web site design product, to
upload Web pages from a remote location or to the local hard drive; to check for dead links; to
create directories; and to set permissions. PWS is frequently used as part of the trend
toward peer-to-peer exchange and publishing.
How to Install Personal Web Server
Starting the Installation
There are two places you can get PWS, both of which are free. The Windows 98 CD
includes it, and you can download it from the Microsoft web site.
Downloading from Microsoft.com
If you don't have the Windows 98 CD, you can download the NT4 Option Pack which,
believe it or not, contains Personal Web Server for Windows 95 and 98.
Be aware that the download is 34mb, which will take nearly 3 hours to download with a
28.8 modem.
To start the download, follow these steps:
1. Go to the microsoft.com web site.
2. Follow the instructions on the web site, choosing Windows 95 as the operating system even if
you're running on Windows 98.
3. After the download, the installation starts.
Installing from Windows 98 CD
To install Microsoft Personal Web Server:
1. Insert your Windows 98 CD-ROM in your CD-ROM drive.
2. Click Start, and then click Run.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
3. In the Open box, type the following path to the Setup.exe file, where x is the letter of
your CD-ROM drive:
x:\add-ons\pws\setup.exe
4. Click OK.
5. Follow the instructions in Personal Web Server Setup.
Internet Information Server (IIS)
Internet Information Server – is a web server application and set of feature extension
modules created by Microsoft for use with Microsoft Windows. It is the most used web server
after Apache HTTP Server. IIS 7.5 supports HTTP, HTTPS, FTP, FTPS, SMTP and NNTP. It is
an integral part of Windows Server family of products, as well as all editions of Windows
Vista and Windows 7, although some features are not supported on client versions of Windows.
IIS is not turned on by default when Windows is installed.
Versions
• IIS 1.0, Windows NT 3.51 available as a free add-on
• IIS 2.0, Windows NT 4.0
• IIS 3.0, Windows NT 4.0 Service Pack 3
• IIS 4.0, Windows NT 4.0 Option Pack
• IIS 5.0, Windows 2000
• IIS 5.1, Windows XP Professional and Windows XP Media Center Edition (requires
retail CD)
• IIS 6.0, Windows Server 2003 and Windows XP Professional x64 Edition
• IIS 7.0, Windows Server 2008 and Windows Vista (Home Premium, Business, Enterprise
and Ultimate editions)
• IIS 7.5, Windows Server 2008 R2 and Windows 7
Features
The architecture of IIS 7 is modular. Modules, also called extensions, can be added or
removed individually so that only modules required for specific functionality have to be
installed. IIS 7 includes native modules as part of the full installation. These modules are
individual features that the server uses to process requests and include the following:
• HTTP modules – Used to perform tasks specific to HTTP in the request-processing
pipeline, such as responding to information and inquiries sent in client headers, returning
HTTP errors, and redirecting requests.
• Security modules – Used to perform tasks related to security in the request-processing
pipeline, such as specifying authentication schemes, performing URL authorization, and
filtering requests.
• Content modules – Used to perform tasks related to content in the request-processing
pipeline, such as processing requests for static files, returning a default page when a
client does not specify a resource in a request, and listing the contents of a directory.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
Compression modules – Used to perform tasks related to compression in the requestprocessing pipeline, such as compressing responses, applying Gzip compression transfer
coding to responses, and performing pre-compression of static content.
• Caching modules – Used to perform tasks related to caching in the request-processing
pipeline, such as storing processed information in memory on the server and using cached
content in subsequent requests for the same resource.
• Logging and Diagnostics modules – Used to perform tasks related to logging and
diagnostics in the request-processing pipeline, such as passing information and
processing status to HTTP.sys for logging, reporting events, and tracking requests
currently executing in worker processes.
IIS 5.0 and higher support the following authentication mechanisms:
• Basic access authentication
• Digest access authentication
• Integrated Windows Authentication
• .NET Passport Authentication (not supported in Windows Server 2008 and above)
IIS 7.5 includes the following additional security features:
• Client Certificate Mapping
• IP Security
• Request Filtering
• URL Authorization
Authentication changed slightly between IIS 6.0 and IIS 7, most notably in that the
anonymous user which was named "IUSR_{machinename}" is a built-in account in Vista and
future operating systems and named "IUSR". Notably, in IIS 7, each authentication mechanism is
isolated into its own module and can be installed or uninstalled.
Apache Web Server
Apache is generally recognized as the world's most popular Web server (HTTP server).
Originally designed for Unix servers, the Apache Web server has been ported to Windows and
other network operating systems (NOS). The name "Apache" derives from the word "patchy"
that the Apache developers used to describe early versions of their software.
The Apache Web server provides a full range of Web server features, including CGI, SSL,
and virtual domains. Apache also supports plug-in modules for extensibility. Apache is reliable,
free, and relatively easy to configure.
Apache is free software distributed by the Apache Software Foundation. The Apache
Software Foundation promotes various free and open source advanced Web technologies.
Features
Apache supports a variety of features, many implemented as compiled modules which
extend the core functionality. These can range from server-side programming language support
to authentication schemes. Some common language interfaces support Perl, Python, Tcl,
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
and PHP. Popular authentication modules include mod_access, mod_auth, mod_digest, and
mod_auth_digest, the successor to mod_digest. A sample of other features
include SSL and TLS support (mod_ssl), a proxy module (mod_proxy), a URL rewriter (also
known as a rewrite engine, implemented under mod_rewrite), custom log files
(mod_log_config), and filtering support (mod_include and mod_ext_filter).
Popular compression methods on Apache include the external extension module,
mod_gzip, implemented to help with reduction of the size (weight) of web pages served
over HTTP. ModSecurity is an open source intrusion detection and prevention engine for web
applications. Apache logs can be analyzed through a web browser using free scripts such
as AWStats/W3Perl or Visitors.
Virtual hosting allows one Apache installation to serve many different actual websites. For
example, one machine with one Apache installation could simultaneously serve
www.example.com, www.test.com, test47.test-server.test.com, etc.
Apache features configurable error messages, DBMS-based authentication databases,
and content negotiation. It is also supported by several graphical user interfaces (GUIs).
Performance
Although the main design goal of Apache is not to be the "fastest" web server, Apache does
have performance comparable to other "high-performance" web servers. Instead of implementing
a single architecture, Apache provides a variety of MultiProcessing Modules (MPMs) which
allow Apache to run in a process-based, hybrid (process and thread) or event-hybrid mode, to
better match the demands of each particular infrastructure. This implies that the choice of correct
MPM and the correct configuration is important. Where compromises in performance need to be
made, the design of Apache is to reduce latency and increase throughput, relative to simply
handling more requests, thus ensuring consistent and reliable processing of requests within
reasonable time-frames.
The Apache version considered by the Apache Foundation as providing high-performances
is the multi-threaded version which mixes the use of several processes and several threads per
process.
While this architecture works faster than the previous multi-process based topology
(because threads have a lower overhead than processes), it does not match the performances of
the event-based architecture provided by other servers, especially when they process events with
several worker threads.
This difference can be easily explained by the overhead that one thread per connection
brings (as opposed to a couple of worker threads per CPU, each processing many connection
events). Each thread needs to maintain its own stack, environment, and switching from one
thread to another is also an expensive task for CPUs.
Installing
Apache can be installed in a variety of ways depending on your operating system and how
much control you want over the installation process. If you are installing the server on a
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Windows machine, you can download the latest binaries from the Apache website.
If you are using a UNIX or Linux operating system (OS), you have more options. The
Apache website has the source code available to download and compile, as well as OS-specific
binaries. You can also install the Web server through the package manager of many Linux and
UNIX systems.
Configuring
Once installed, there are two main configuration files that should be edited. These files are
plain text files that can be opened in any text editor. The files contain one directive per line and
are case insensitive. Lines starting with the # character are considered comments and are ignored
by the server.
The main configuration file is the httpd.conf file. Linux/Unix users will usually find this
file at /etc/httpd/httpd.conf. However, the Debian-based Linux distributions place the file at
/etc/apache2/apache2.conf. The default location in the Windows OS is C:\Program Files\Apache
Group\Apache2\conf\httpd.conf.
The httpd.conf file holds the system information such as the server root directory, the
listening port, the maximum number of clients who can simultaneously connect and the number
of server instances the software can start at one time. Apache can also be configured for virtual
hosting, which allows one server to serve many different clients at one time. The virtual host
directives are also held in the httpd.conf file.
The .htaccess file is a way to make changes to the main configuration on a directory level.
This file must be created on a per-directory basis, and the configuration changes are applicable
only for the directory it resides in and any subdirectories. The .htaccess file allows you to require
authentication before allowing site access, provide redirection, specify cgi handling and much
more. The entire list of directives can be found in the Apache documentation.
Starting
The Apache Web server runs as a service on all operating systems. A service is a software
application that runs in the background with no user intervention. This allows outside users to
access the Web pages any time the physical server is turned on, regardless of whether a user is
logged in or not.
In Windows, you start the service under the "Services" option of the Control Panel. There
will be a list of every service available to the users. You will choose the "Apache" service and
click "Start" next to it. To stop the service, you simply click "Stop."
Starting a service is different for Linux/Unix users. You must open a terminal window,
which is found under "System Tools" or "Utilities" in the main "Applications" or "Start" menu.
The service must be started by the root user. You can either switch to root using the "su"
command or place the word "sudo" before the commands. The command to start the service is:
/etc/init.d/apache2 start
The command to stop the service is:
/etc/init.d/apache2 stop
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Once the service is started, you can test your configuration by typing "http://localhost" in a
Web browser address bar.
Section D: Privacy and Security Topics
Software Complexity
Contributing Factors
• Program Size – A browser may consist of as many as 75000 lines of source code. The
executable file for a browser is usually on the order of 5 to 7 mega bytes. It is very
difficult to eliminate all errors in such an immense program.
• Software Interfaces – The need for the browsers to interface with other software creates
an even larger code base and more potential problem areas.
• Market Forces – Products must be hurried to market in order to maintain a competitive
edge. It is often challenging to test all parts of them thoroughly before release. One
reason why new versions of large software systems come out so frequently is that bugs
are addressed in newer releases.
• Team Development – Large teams of programmers are often used to develop
complicated programs such as browsers. Very few individuals can handle such a task
alone. Inconsistent styles, or even just carelessness on the part of a single programmer
can result in bugs that are very difficult to find and correct.
Encryption
There's a whole lot of information that we don't want other people to see, such as:
• Credit-card information
• Social Security numbers
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
•
•
•
•
Private correspondence
Personal details
Sensitive company information
Bank-account information
Encryption is the conversion of data into a form, called a ciphertext, that cannot be easily
understood by unauthorized people. Decryption is the process of converting encrypted data back
into its original form, so it can be understood.
The use of encryption/decryption is as old as the art of communication. In wartime,
a cipher, often incorrectly called a code, can be employed to keep the enemy from obtaining the
contents of transmissions. (Technically, a code is a means of representing a signal without the
intent of keeping it secret; examples are Morse code and ASCII.) Simple ciphers include the
substitution of letters for numbers, the rotation of letters in the alphabet, and the "scrambling" of
voice signals by inverting the sideband frequencies. More complex ciphers work according to
sophisticated computer algorithms that rearrange the data bits in digital signals.
In order to easily recover the contents of an encrypted signal, the correct decryption key is
required. The key is an algorithm that undoes the work of the encryption algorithm.
Alternatively, a computer can be used in an attempt to break the cipher. The more complex the
encryption algorithm, the more difficult it becomes to eavesdrop on the communications without
access to the key.
Encryption/decryption is especially important in wireless communications. This is because
wireless circuits are easier to tap than their hard-wired counterparts. Nevertheless,
encryption/decryption is a good idea when carrying out any kind of sensitive transaction, such as
a credit-card purchase online, or the discussion of a company secret between different
departments in the organization. The stronger the cipher -- that is, the harder it is for
unauthorized people to break it -- the better, in general. However, as the strength of
encryption/decryption increases, so does the cost.
In recent years, a controversy has arisen over so-called strong encryption. This refers to
ciphers that are essentially unbreakable without the decryption keys. While most companies and
their customers view it as a means of keeping secrets and minimizing fraud, some governments
view strong encryption as a potential vehicle by which terrorists might evade authorities. These
governments, including that of the United States, want to set up a key-escrow arrangement. This
means everyone who uses a cipher would be required to provide the government with a copy of
the key. Decryption keys would be stored in a supposedly secure place, used only by authorities,
and used only if backed up by a court order. Opponents of this scheme argue that criminals could
hack into the key-escrow database and illegally obtain, steal, or alter the keys. Supporters claim
that while this is a possibility, implementing the key escrow scheme would be better than doing
nothing to prevent criminals from freely using encryption/decryption.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Encryption Schemes
Computer encryption is based on the science of cryptography, which has been used as
long as humans have wanted to keep information secret. Before the digital age, the biggest users
of cryptography were governments, particularly for military purposes.
The Greek historian Plutarch wrote, for example, about Spartan generals who sent and
received sensitive messages using a scytale, a thin cylinder made out of wood. The general
would wrap a piece of parchment around the scytale and write his message along its length.
When someone removed the paper from the cylinder, the writing appeared to be a jumble of
nonsense. But if the other general receiving the parchment had a scytale of similar size, he could
wrap the paper around it and easily read the intended message.
The Greeks were also the first to use ciphers, specific codes that involve substitutions or
transpositions of letters and numbers. Here's an example of a typical cipher, with a grid of letters
and their corresponding numbers:
1
2
3
4
5
1
A
B
C
D
E
2
F
G
H
I/J
K
3
L
M
N
O
P
4
Q
R
S
T
U
5
V
W
X
Y
Z
If a Spartan general wished to send the message I AM SPARTA to another general, he
would write this series of numbers:
42 11 23 34 53 11 24 44 11
As long as both generals had the correct cipher, they could decode any message the other
sent. To make the message more difficult to decipher, they could arrange the letters inside the
grid in any combination.
Most forms of cryptography in use these days rely on computers, simply because a humanbased code is too easy for a computer to crack. Ciphers are also better known today
as algorithms, which are the guides for encryption -- they provide a way in which to craft a
message and give a certain range of possible combinations. A key, on the other hand, helps a
person or computer figure out the one possibility on a given occasion.
Computer encryption systems generally belong in one of two categories:
• Symmetric-key encryption
• Public-key encryption
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Symmetric Key
Just like two Spartan generals sending messages to each other, computers using symmetrickey encryption to send information between each other must have the same key.
In symmetric-key encryption, each computer has a secret key (code) that it can use to
encrypt a packet of information before it is sent over the network to another computer.
Symmetric-key requires that you know which computers will be talking to each other so you can
install the key on each one. Symmetric-key encryption is essentially the same as a secret code
that each of the two computers must know in order to decode the information. The code provides
the key to decoding the message.
Caesar's Cipher
Julius Caesar also used a similar substitution technique, shifting three letters up. If he
wanted to say "CROSSING THE RUBICON," for instance, he'd write down "FURVV LQJWK
HUXEL FRQ" instead. As you can see, the text is also broken up into even groups in order to
make the size of each word less obvious.
Think of it like this: You create a coded message to send to a friend in which each letter is
substituted with the letter that is two down from it in the alphabet. So "A" becomes "C," and "B"
becomes "D". You have already told a trusted friend that the code is "Shift by 2". Your friend
gets the message and decodes it. Anyone else who sees the message will see only nonsense.
The same goes for computers, but, of course, the keys are usually much longer.
Public Key Encryption
One of the weaknesses some point out about symmetric key encryption is that two users
attempting to communicate with each other need a secure way to do so; otherwise, an attacker
can easily pluck the necessary data from the stream.
Also known as asymmetric-key encryption, public-key encryption uses two different keys
at once -- a combination of a private key and a public key. The private key is known only to your
computer, while the public key is given by your computer to any computer that wants to
communicate securely with it. To decode an encrypted message, a computer must use the public
key, provided by the originating computer, and its own private key. Although a message sent
from one computer to another won't be secure since the public key used for encryption is
published and available to anyone, anyone who picks it up can't read it without the private key.
The key pair is based on prime numbers (numbers that only have divisors of itself and one, such
as 2, 3, 5, 7, 11 and so on) of long length. This makes the system extremely secure, because there
is essentially an infinite number of prime numbers available, meaning there are nearly infinite
possibilities for keys. One very popular public-key encryption program is Pretty Good Privacy
(PGP), which allows you to encrypt almost anything.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
To implement public-key encryption on a large scale, such as a secure Web server might
need, requires a different approach. This is where digital certificates come in. A digital certificate
is basically a unique piece of code or a large number that says that the Web server is trusted by
an independent source known as a certificate authority. The certificate authority acts as a
middleman that both computers trust. It confirms that each computer is in fact who it says it is,
and then provides the public keys of each computer to the other.
Hashing Algorithm
The key in public-key encryption is based on a hash value. This is a value that is computed
from a base input number using a hashing algorithm. Essentially, the hash value is a summary of
the original value. The important thing about a hash value is that it is nearly impossible to derive
the original input number without knowing the data used to create the hash value. Here's a simple
example:
Input number
Hashing algorithm
Hash value
10,667
Input # x 143
1,525,381
You can see how hard it would be to determine that the value 1,525,381 came from the
multiplication of 10,667 and 143. But if you knew that the multiplier was 143, then it would be
very easy to calculate the value 10,667. Public-key encryption is actually much more complex
than this example, but that's the basic idea.
Public keys generally use complex algorithms and very large hash values for encrypting,
including 40-bit or even 128-bit numbers. A 128-bit number has a possible 2128, or
3,402,823,669,209,384,634,633,746,074,300,000,000,000,000,000,000,000,000,000,000,000,000
different combinations -- this would be like trying to find one particular grain of sand in the
Sahara Desert.
Secure Web Documents
If you notice a broken skeleton or an unlocked padlock displayed in the lower left corner of
the browser window, you are looking at icons that indicate that the document is not secure. Most
documents on the Web are not secure. When the skeleton key is whole or the padlock is locked,
you are looking at a secure document. Secure documents require a secure server, which is a
server that uses encryption schemes. The URL of a secure document usually begins with https,
rather than http, where the s means secure.
When a client requests a secure document, the server must first determine if they have the
permission required to retrieve the document. The authentication process may require the user to
submit a password. The server and the client must agree on an encryption scheme, so that all
messages (including password) can be transmitted securely. Users may have to obtain a private
key via some other mechanism (such as s-mail) before they can authenticate themselves to a
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
secure server and decrypt messages. A high level of security can thus be achieved on the web,
using the encryption schemes currently available
Digital Signature
A digital signature (not to be confused with a digital certificate) is an electronic signature
that can be used to authenticate the identity of the sender of a message or the signer of a
document, and possibly to ensure that the original content of the message or document that has
been sent is unchanged. Digital signatures are easily transportable, cannot be imitated by
someone else, and can be automatically time-stamped. The ability to ensure that the original
signed message arrived means that the sender cannot easily repudiate it later.
A digital signature can be used with any kind of message, whether it is encrypted or not,
simply so that the receiver can be sure of the sender's identity and that the message arrived intact.
A digital certificate contains the digital signature of the certificate-issuing authority so that
anyone can verify that the certificate is real.
How It Works
Assume you were going to send the draft of a contract to your lawyer in another town. You
want to give your lawyer the assurance that it was unchanged from what you sent and that it is
really from you.
1. You copy-and-paste the contract (it's a short one!) into an e-mail note.
2. Using special software, you obtain a message hash (mathematical summary) of the
contract.
3. You then use a private key that you have previously obtained from a public-private key
authority to encrypt the hash.
4. The encrypted hash becomes your digital signature of the message. (Note that it will be
different each time you send a message.)
At the other end, your lawyer receives the message.
1. To make sure it's intact and from you, your lawyer makes a hash of the received message.
2. Your lawyer then uses your public key to decrypt the message hash or summary.
3. If the hashes match, the received message is valid.
Firewalls
A firewall is a part of a computer system or network that is designed to block unauthorized
access while permitting authorized communications. It is a device or set of devices that is
configured to permit or deny network transmissions based upon a set of rules and other criteria.
Firewalls can be implemented in either hardware or software, or a combination of both.
Firewalls are frequently used to prevent unauthorized Internet users from accessing private
networks connected to the Internet, especially intranets. All messages entering or leaving the
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
intranet pass through the firewall, which inspects each message and blocks those that do not meet
the specified security criteria.
The Nature of Today’s Attackers
Who are these “hackers” who are trying to break into your computer? Most people imagine
someone at a keyboard late at night, guessing passwords to steal confidential data from a
computer system. This type of attack does happen, but it makes up a very small portion of the
total network attacks that occur. Today, worms and viruses initiate the vast majority of attacks.
Worms and viruses generally find their targets randomly. As a result, even organizations with
little or no confidential information need firewalls to protect their networks from these
automated attackers.
If a worm or a virus does find security vulnerability and compromises your system, it can
do one of several things. To begin with, it will almost always start looking for other systems to
attack so that it can spread itself further. In this case, you become one of the bad guys—because
the worm or virus is using your computer to attack other systems on your internal network and
the Internet, wasting your computing resources and bandwidth. Even though the worm or virus
won’t know what to do with your confidential data, chances are good that it will open a new
back door into your system to allow someone else to further abuse your computer and
compromise your privacy. Worms and viruses have dramatically increased the need for network
security of all kinds—especially the need for host-based firewalls.
Individuals still launch some attacks, though, and these are generally the most dangerous.
The least worrisome attackers focus on crashing computers and networks by using Denial of
Service (DoS) attacks. Others might be looking for confidential data that they can abuse for
profit, such as sales contacts, financial data, or customer account information. Still others might
be amassing hundreds or thousands of computers from which to launch a distributed attack
against a single network on the Internet.
The Firewall to the Rescue
In the physical world, businesses rely on several layers of security. First, they rely on their
country’s government and military forces to keep order. Then, they trust their local police to
patrol the streets and respond to any crimes that occur. They further supplement these public
security mechanisms by using locks on doors and windows, employee badges, and security
systems. If all these defenses fail and a business is a victim of a crime, the business’s insurance
agency absorbs part of the impact by compensating the business for a portion of the loss.
Just as you lock your car and home, you need to protect your computers and networks.
Firewalls are these locks, and just like in the physical world, they come in different shapes and
sizes to suit different needs. The famous Jargon Dictionary has a great definition for firewall: “a
dedicated gateway machine with special security precautions on it, used to service outside
network connections and dial-in lines.”
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]
Firewalls serve two useful purposes:
• they filter what traffic comes into your network from the outside world, and
• they control what computers on your network may send there.
It’s important to understand one thing, however. No firewall—whether a small, free hostbased firewall or a multiple-thousand-dollar enterprise firewall array—will make your computers
impervious to attack. Firewalls, like locks and walls and moats and dragons, create barriers to
attack—they get in the way of someone trying to take control. By making it difficult for attackers
to get into your computer, by making them invest lots of time, you become less attractive.
Firewalls very effectively block most bad guys from compromising an individual computer. But
it’s impossible to fully prevent every intrusion: All software has bugs, and someone might find
an obscure bug in your firewall that allows them to pass through. In a nutshell, there’s no such
thing as absolute security..
Types of Firewalls
There are two main types of firewalls:
• Network firewalls and
• Host-based firewalls.
Network firewalls, such as the software-based Microsoft’s Internet Security and Acceleration
(ISA) Server or the hardware-based Nortel Networks Alteon Switched Firewall System, protect
the perimeter of a network by watching traffic that enters and leaves.
Host-based firewalls, such as Internet Connection Firewall (ICF—included with Windows XP
and Windows Server 2003), protect an individual computer regardless of the network it’s
connected to. You might need one or the other—but most businesses require a combination of
both to meet their security requirements.
World Institute Of Technology
8km milestone ,Sohna Palwal Road , NH-71 B ,Sohna , Gurgaon ,Haryana.
Website : www.wit.net.in
E-mail : [email protected]