0% found this document useful (0 votes)
6 views8 pages

assignment 1

The document provides an overview of client-server architecture in web technology, detailing the roles of clients and servers, as well as key web protocols like HTTP and HTTPS. It also explains web hosting types, the domain registration process, and the maintenance of websites. Additionally, it covers the structure of HTML5 documents, the use of HTML forms, and the definition of XML along with its validation methods using DTD and XML Schema.

Uploaded by

Raman Kashyap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views8 pages

assignment 1

The document provides an overview of client-server architecture in web technology, detailing the roles of clients and servers, as well as key web protocols like HTTP and HTTPS. It also explains web hosting types, the domain registration process, and the maintenance of websites. Additionally, it covers the structure of HTML5 documents, the use of HTML forms, and the definition of XML along with its validation methods using DTD and XML Schema.

Uploaded by

Raman Kashyap
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Name: -Raman Kashyap

Class: -IoT-B
Roll No.: -2401331550096
Subject: -Web Technology
Erp Id : -0241CSIOT113

Assignment 1

Que: -1 Explain the client–server architecture in web technology. Describe the role of web
protocols in enabling communication between the client and server. Illustrate your answer with
a neat diagram.

Ans:-Client–Server Architecture in Web Technology


Client–server architecture is a distributed computing model in which tasks are divided between
clients (requesters of services) and servers (providers of services). In web technology, this
architecture forms the foundation of how websites and web applications work.

1. Client–Server Architecture

● Client
The client is usually a web browser (e.g., Chrome, Firefox) or a mobile app.

o Sends requests for web resources

o Displays content to the user

o Handles user interaction (forms, clicks, inputs)

● Server
The server is a powerful computer system that stores and manages web resources.
o Processes client requests

o Executes server-side logic (e.g., PHP, Java, Python)

o Accesses databases

o Sends responses back to the client

Working Principle:
1. The client sends a request (e.g., for a web page).
2. The server receives and processes the request.
3. The server sends the requested data (HTML, JSON, images, etc.) back to the client.

4. The client renders the response for the user.

2. Role of Web Protocols in Client–Server Communication


Web protocols define rules and standards that enable communication between the client and
server.

Key Web Protocols:

● HTTP (Hypertext Transfer Protocol)


o Core protocol of the web

o Handles request–response communication

o Stateless in nature

o Methods: GET, POST, PUT, DELETE

● HTTPS (HTTP Secure)


o Secure version of HTTP

o Uses SSL/TLS encryption

o Ensures data confidentiality, integrity, and authentication

● TCP/IP (Transmission Control Protocol / Internet Protocol)


o TCP ensures reliable data delivery

o IP handles addressing and routing of data packets

● DNS (Domain Name System)


o Translates domain names (e.g., [Link]) into IP addresses
Que: -2 What is web hosting? Discuss the different types of web hosting services. Explain the
steps involved in registering a domain and maintaining a website.

Ans:-Web Hosting
Web hosting is a service that allows individuals or organizations to make their websites
accessible on the Internet. Web hosting providers allocate space on a server, along with
resources such as storage, bandwidth, and network connectivity, to store website files (HTML,
CSS, images, databases, etc.) and deliver them to users when requested through a web browser.

Types of Web Hosting Services

1. Shared Hosting
o Multiple websites share the same server and its resources.

o Low cost and easy to manage.

o Suitable for small websites and beginners.


o Limited performance and control.

2. VPS (Virtual Private Server) Hosting


o A physical server is divided into multiple virtual servers.

o Each website gets dedicated resources.

o Better performance and security than shared hosting.

o Suitable for medium-sized websites.

3. Dedicated Hosting
o A single client uses an entire physical server.

o High performance, full control, and customization.

o Expensive and requires technical expertise.

o Suitable for large websites with heavy traffic.

4. Cloud Hosting
o Website is hosted on a network of interconnected servers.

o Scalable and highly reliable.

o Pay-as-you-use pricing model.

o Suitable for websites with variable traffic.

5. Reseller Hosting
o Allows users to resell hosting services to others.
o Used by web designers or agencies.

o Provides control over multiple client accounts.

6. Managed Hosting
o Hosting provider manages server maintenance, updates, and security.

o Reduces technical burden on the website owner.

o Common with WordPress hosting.

The Domain Registration Process


A domain name acts as a human-readable alias for a server's IP Address. The registration
follows these steps:

1. Selection & Availability Check: The user chooses a string (e.g., mycollegeproject)
and a TLD (Top-Level Domain) like .com or .in.
2. Registrar Interaction: An application is submitted to a Domain Registrar (e.g.,
GoDaddy, Namecheap).

3. DNS Mapping: Once purchased, the registrar updates the Registry (the central
database). You must then point your Name Servers to your web host's IP address.

4. Propagation: It can take 24–48 hours for the new DNS records to update across all
global servers.

Steps to Maintain a website


Maintenance is critical for security and user experience. It involves:

● Security Management: Implementing SSL/TLS certificates for encryption and


regular scanning for malware or SQL injection vulnerabilities.

● Performance Optimization: Monitoring server response times and using Content


Delivery Networks (CDNs) to cache data closer to users.

● Software Updates: For CMS-based sites (like WordPress), keeping the core, themes,
and plugins updated to patch security flaws.

● Database Optimization: Periodically cleaning the database (especially for Java or C-


based backends) to ensure query efficiency.

● Backups: Maintaining redundant copies of both the source code and the database (off-
site or in the cloud).

Que: -3 Explain the basic structure of an HTML5 document. Describe the use of HTML forms
and new HTML5 form elements used for user input with suitable examples.

Ans: Basic Structure of an HTML5 Document


An HTML5 document follows a simple and standardized structure that defines the content and
layout of a web page.

<html>
<head>

<title>My First HTML5 Page</title>

</head>

<body>

<h1>Welcome to HTML5</h1>

<p>This is a basic HTML5 document. </p>

</body>

</html>

Explanation of elements:
● <html>
Root element that contains the entire HTML document.

● <head>
Contains meta information such as title, character encoding, and links to CSS.

● <title>
Displays the page title on the browser tab.
● <body>
Contains the visible content of the web page.
2. Use of HTML Forms

HTML forms are used to collect user input and send data to a server for processing. Forms are
commonly used for login pages, registration forms, feedback forms, and search boxes.
Basic syntax of a form:

<form>

<label>Name:</label>

<input type="text">

<label>Email:</label>

<input type="email">

<input type="submit" value="Submit">


</form>
● action specifies the server page that processes the form data.

● method defines how data is sent (GET or POST).

3. New HTML5 Form Elements for User Input (with Examples)


HTML5 introduced new input types and attributes that improve user experience and validation.

a) Email Input
<input type="email" name="email">

Ensures the user enters a valid email address.

b) URL Input
<input type="url" name="website">

Validates web addresses.

c) Number Input
<input type="number" min="1" max="100">

Accepts only numeric values within a range.

d) Date Input
<input type="date" name="dob">

Provides a date picker.

e) Range Input
<input type="range" min="0" max="10">

Displays a slider control.

f) Placeholder Attribute
<input type="text" placeholder="Enter your name">
Displays hint text inside the input field.

g) Required Attribute
<input type="text" required>

Makes the field mandatory.


Que: -4 Define XML. Explain the structure of an XML document and discuss the role of DTD
and XML Schema in validating XML documents.

Ans: XML (Extensible Markup Language) is a text-based markup language derived


from SGML (Standard Generalized Markup Language). Its primary purpose is to store
and transport data in a format that is both human-readable and machine-readable.
Unlike HTML, which focuses on how data looks (presentation), XML focuses on what data is
(structure and meaning). It is "extensible" because it does not have a predefined set of tags;
instead, you define your own tags to suit your specific data needs.

Structure of an XML Document


An XML document follows a strict hierarchical (tree-like) structure. For a document to be
"Well-Formed," it must follow specific syntax rules.

1. The XML Declaration


The first line of the document, which specifies the XML version and the character encoding
used.

● Example: <?xml version="1.0" encoding="UTF-8"?>

2. The Root Element


Every XML document must contain exactly one Root Element that encloses all other elements.
This is the "parent" of the entire tree.

3. Elements and Tags


Elements are the building blocks of XML. They consist of a start tag (e.g., <price>), content,
and an end tag (e.g., </price>). Tags are case-sensitive.

4. Attributes
Attributes provide additional information about an element and are placed within the start tag.

● Example: <book category="fiction">

5. Nesting
Elements must be properly nested. You cannot close a parent tag before closing its child tag.
Example of a Well-Formed XML Document:

XML

<?xml version="1.0" encoding="UTF-8"?>

<library>

<book id="101">
<title>Data Science Basics</title>
<author>Jane Doe</author>

<year>2023</year>

</book>

</library>

Validating XML: DTD and XML Schema


While "Well-Formed" XML follows basic syntax, "Valid" XML must also follow a specific
set of rules regarding its content (e.g., "A 'book' must always have a 'title'"). These rules are
defined using DTD or XML Schema.

1. DTD (Document Type Definition)


DTD is the older, traditional way to define the structure of an XML document. It lists the legal
elements and attributes.

● Syntax: Uses a non-XML syntax.

● Data Types: Very limited; it treats almost all data as strings (PCDATA).

● Simplicity: Easier to write but less powerful.

2. XML Schema (XSD - XML Schema Definition)


XML Schema is the modern, more powerful successor to DTD.

● Syntax: Written in XML itself, meaning it can be parsed just like an XML document.

● Data Types: Supports complex data types (integers, dates, decimals, etc.) and custom
constraints (e.g., "value must be between 1 and 100").

● Namespace Support: Supports namespaces, which prevents naming conflicts between


different XML vocabularies.

You might also like