0% found this document useful (0 votes)
64 views2 pages

WEBtek

The document discusses features in HTML5 such as embedding audio/video, client-side storage, and new structural elements. It also covers differences between XML and HTML such as XML being case-sensitive and focusing on data transport, while HTML focuses on appearance. XML Schema Definition (XSD) allows defining structure, content, and data types for XML documents.

Uploaded by

Ujjwal Adhikari
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)
64 views2 pages

WEBtek

The document discusses features in HTML5 such as embedding audio/video, client-side storage, and new structural elements. It also covers differences between XML and HTML such as XML being case-sensitive and focusing on data transport, while HTML focuses on appearance. XML Schema Definition (XSD) allows defining structure, content, and data types for XML documents.

Uploaded by

Ujjwal Adhikari
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
You are on page 1/ 2

2/17/23, 9:44 AM WEBtek

Features in HTML5 are;


 The DOCTYPE declaration for HTML5 is very simple, <!DOCTYPE
html>
 The character encoding<meta charset=”UTF-8”>
 New function for embedding audio(<audio>), video(<video>),
graphics(<svg> and<canvas>)  Client-side data storage
1 An XML schema is a way of defining the structure and content of
an XML document, providing a set of rules and constraints that
must be followed to ensure valid XML documents. XML vs DTD
Syntax: DTD uses a different syntax from XML, XML Schema is
written in XML syntax itself. Validation: DTDs only support a limited set
2
of validation rules, XML Schema supports more advanced validation
 Interactive documents capabilities such as data typing, facet constraints, and the ability to define
 New structural elements <article> ,<header>,<footer>,<nav>, user-defined data types. Namespace support: DTDs do not support XML
<section>,and<figure>  Java script enhancement namespaces, XML Schema provides full support for namespaces.
 New from control calendar, date, time, email, url, search Extensibility: DTDs are not extensible, XML Schema allows the definition
 HTML Geolocation, HTML Drag And Drop, html local storage, HTML of complex types and the extension of types through inheritance and
Application Cash derivation. Readability: XML Schema is considered to be more human-
<!DOCTYPE html> readable and easier to understand.
<html> XML vs HTML
<head>
<title>Example Form</title> The main purpose is to focus on the Focusses on the appearance of data.
</head> transport and saving the data. Enhances the appearance of text
<body>
<form action="submit.php" method="post"> XML is dynamic because it is used in HTML is static because its main
<fieldset> the transport of data. function is in the display of data.
<legend>Personal Information</legend> It is case-sensitive. It is not case-sensitive.
<label for="name">Name:</label>
<input type="text" id="name" name="name" required><br> XML can preserve white spaces. are not preserved
<label for="email">Email:</label> You can define tags as per your
<input type="email" id="email" name="email" required><br> requirement
it have predefined tag
<label for="phone">Phone:</label>
<input type="tel" id="phone" name="phone" pattern="[0-9]{3}-[0- XML is used for storing and exchanging data while CSS is used for styling
9]{3}-[0-9]{4}" placeholder="###-###-####"><br> and presenting content. XML focuses on the structure and content of data,
CSS focuses on the appearance and presentation of data on a web page.
<label for="birthdate">Birthdate:</label>
<input type="date" id="birthdate" name="birthdate" max="2004- XML schema:
12-31"><br> <?xml version="1.0" encoding="UTF-8"?>
<label for="gender">Gender:</label> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<select id="gender" name="gender"> <xs:element name="address">
<option value="">Please select</option> <xs:complexType>
<option value="male">Male</option> <xs:attribute name="city" type="xs:string" />
<option value="female">Female</option> <xs:attribute name="state" type="xs:string" />
<option value="other">Other</option> <xs:attribute name="street" type="xs:string" />
</select><br> <xs:attribute name="house-no" type="xs:string" />
<label for="newsletter">Sign up for newsletter:</label> </xs:complexType>
<input type="checkbox" id="newsletter" name="newsletter" </xs:element>
value="yes"><br> </xs:schema>
<label for="comments">Comments:</label> Represent data types in XML schema:
<textarea id="comments" name="comments"></textarea><br>
</fieldset> Built-in Data Types: XML Schema provides several built-in data types such
<legend>Shipping Information</legend> as string, integer, decimal, boolean, and date. You can use these data
<label for="address">Address:</label> types in your schema by specifying them as the type of an element or
<input type="text" id="address" name="address"><br> attribute.
<label for="city">City:</label> <xs:element name="count" type="xs:positiveInteger"/>
<input type="text" id="city" name="city"><br> User-Defined Data Types: It allows you to define your own data types that
<label for="state">State:</label> can be used to validate the content of an XML document. You can define a
<input type="text" id="state" name="state"><br> data type by specifying its base type and adding constraints on it.
<label for="zip">Zip code:</label> <xs:simpleType name="phoneType">
<input type="text" id="zip" name="zip"><br> <xs:restriction base="xs:string">
<input type="submit" value="Submit"> <xs:length value="10"/>
<input type="reset" value="Reset"> </xs:restriction>
</form> </xs:simpleType>
</body>
</html> >>XSD (XML Schema Definition) is a language used for defining the
structure, content, and data types of XML documents.

3 4
1

To create an XML parser: Define the XML syntax: Before you can Client/Server Arch
build a parser, you need to understand the syntax of the XML 2 Tier Arch: It runs the client processes separately from the server
language. XML consists of elements, attributes, and text content, processes, usually on a different computer: >>The client processes
all enclosed within tags. You'll need to define the rules for parsing provide an interface for the customer, and gather and present data
these elements and attributes. Implement the parser: You can usually on the customer’s computer. This part of the application is the
implement the parser in your preferred programming language. One presentation layer  The server processes provide an interface with the data
approach is to use a tokenizer to break the input XML file into smaller store of the business. This part of the application is the data layer.  The
chunks, such as elements, attributes, and text nodes. Then, you can use a business logic that validates data, monitors security and permissions, and
parser to parse these chunks and build a data structure that represents performs other business rules can be housed on either the client or the server, or
the XML document . Handle errors: It's important to handle errors in the split between the two. o Fundamental units of work required to complete the
XML file, such as missing tags or improperly formatted data. You'll need to business process o Business rules can be automated by an application program.
define rules for detecting and handling these errors. Output the parsed Merits: Easy to maintain and modification is bit easy  Communication is faster .
Demerits; Performance will be degrade upon increasing the users.  Cost –
data: Once the parser has successfully parsed the XML document, you can
output the data in your preferred format, such as a JSON object, database, ineffective
or HTML page. 3 tier Arch: 3-tier architecture is a specific implementation of the client/server
model, where the system is divided into three main layers: presentation layer,
>>XSLT (Extensible Stylesheet Language Transformations) is a language application logic layer, and data storage layer. The presentation layer deals with
used for transforming XML documents into other formats, such as HTML, user interface and presentation logic, the application logic layer handles the
plain text, or other XML documents business logic, and the data storage layer deals with data storage and retrieval.
>>XPath (XML Path Language) is a language used to query XML documents Merits:  High performance  High degree of flexibility in deployment platform
and configuration  Better re-use  Improve Data integrity  Improved security –
and navigate through their elements and attributes. XPath is used to select
nodes or sets of nodes from an XML document, based on certain criteria . client is not direct access to database  Easy to maintain and modification is bit
easy, won’t affect other modules  In three tier architecture application
The XML DOM (Document Object Model) is a programming interface for performance is good Demerits: Increase complexity /effort .
XML documents. It provides a hierarchical representation of an XML
N Tier Arch: N-tier architecture, also known as multi-tier architecture, is a
document as a tree structure, which can be manipulated with software architecture pattern that extends the 3-tier architecture by adding
programming languages like JavaScript, Python, and Java. additional tiers or layers. The "N" in N-tier refers to any number of additional
>>DTD stands for Document Type Definition, which is a way to define the layers beyond the three tiers in the traditional 3-tier architecture. In an N-tier
structure, elements, and attributes of an XML (Extensible Markup architecture, the software system is divided into multiple layers or tiers that are
Language) document .Internal declaration refers to the part of a DTD loosely coupled and independent of each other. Each layer provides a specific
that is included within the document itself, typically enclosed in a pair of functionality and communicates with the other layers through well-defined
square brackets [ ]. This internal subset is used to declare the rules for the interfaces. The layers are typically organized in a hierarchical fashion, with higher-
level layers depending on lower-level layers. Merits:  Changes to the user
document type being defined, such as the elements, attributes, entities, interface or to the application logic are largely independent from one another,
and notations. Internal declarations are only accessible within the allowing the application to evolve easily to meet new requirements.  Network
document in which they are defined and cannot be reused in other bottlenecks are minimized because the application layer does not transmit extra
documents. Private external declaration refers to the part of a DTD that data to the client, only what is needed to handle a task.  The client is insulated
is located in an external file, typically referenced by the document using a from database and network operations. The client can access data easily and
system identifier. Private external declarations are used when a DTD is quickly without having to know where data is or how many servers are on the
defined separately from the document that uses it, allowing the same DTD system.  Database connections can be 'pooled' and thus shared by several users,
to be shared by multiple documents. Private external declarations are only which greatly reduces the cost associated with per-user licensing.
accessible to documents that explicitly reference the external DTD file, and SESSION: In web development, a session is a way to keep track of a user's
they are not available to other documents that do not have access to the activity on a website or web application. When a user interacts with a web
same DTD file. application, the web server creates a unique session for that user, which is
Tag Libraries: identified by a session ID. Merits :  It helps maintain user state and data all the
application.  It is easy to implement and we can store any kind of object eg.
In a web application, a common design goal is to separate the display code
from business logic. Java tag libraries are one solution to this problem. Database, dataset etc.  Stores client data separately  Session is secure and
Tag libraries allow isolating business logic from the display code by transparent from the use. DEmerits :  As session is stored on the server
memory, it is not advisable to user session state when there is a large volume of
creating a tag class and including an HTML – like tag in JSP page.
data.  With the use of session state, it will affect the performance of
Error handling is the process of responding to and recovering from error memory, because it stored in server memory until you destroy the state
conditions in your program. a) Syntax Error b) Logical Error c) Runtime USES:  Carrying information as a client travels between pages.  One page data
SESSION vs COOKIES: can be stored in session variable and that data can be accessed from other pages.
 Session can help to uniquely identify each client from another  Session is
1.Session expires when the browser is closed. 1 Cookies last longer than mostly used in ecommerce sites where there is shopping cart system.  It helps
session 2 Session are stored on the server computer 2 Cookies are stored maintain user state and data all over the application.  It is easy to implement
on the user’s computer 3 Session are reliable and more secure as we and we can store any kind of object.  Stores client data separately.  Session is
cannot easily access the session value 3 Cookies are unreliable and less secure and transparent from the user.
secure as we can easily access the cookie value 4 Session can store
unlimited amount of data 4 Cookies can store only limited amount of data(
maximum cookie size is 4KB) 5 Session is mainly used for login/logout
purpose 5 Cookies using for user activity tracking .

about:blank 1/2
2/17/23, 9:44 AM WEBtek

Server-side script for implementing login:


<?php
session_start();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$email = $_POST["email"];
5 Anonymous access? Discuss Integrated windows authentication
Anonymous access refers to the ability of a user or client to access
a resource or system without providing any identifying information
or credentials.
Integrated Windows Authentication (IWA) is a type of authentication
6
$password = $_POST["password"]; mechanism that is used in Windows-based environments. With IWA, users
$db = new mysqli("localhost", "username", "password", can access network resources without having to provide a separate set of
"database_name"); credentials. Instead, IWA leverages the user's Windows credentials to
$stmt = $db->prepare("SELECT id, email, password FROM users WHERE provide authentication and access control.IWA works by using the user's
email = ?"); Windows logon credentials to authenticate them to the network resource
$stmt->bind_param("s", $email); they are trying to access. When a user attempts to access a resource, their
$stmt->execute(); browser sends a request to the server hosting the resource. The server
$result = $stmt->get_result(); then responds with a challenge that the browser uses to authenticate the
$user = $result->fetch_assoc(); user using their Windows credentials. If the authentication is successful,
the user is granted access to the resource. One of the benefits of IWA is
if ($user && password_verify($password, $user["password"])) { that it provides a seamless user experience, as the user is not required to
$_SESSION["user_id"] = $user["id"]; provide separate credentials to access network resources. However, there
header("Location: dashboard.php"); are some limitations to IWA. It requires that the user's browser supports
exit(); IWA, and it may not be compatible with non-Windows operating systems.
} else { File Handling:
$error = "Invalid email or password"; File handling refers to the process of reading from and writing to files on a
}} web server. It involves creating, editing, deleting, and manipulating files on
?> a web server. In web development, file handling is used to store and
retrieve data in the form of text, images, videos, and other types of media.
<!-- Display the login form --> It is used to manage user-generated content, such as file uploads, or to
<form method="post" action=""> manage the configuration files of a web application.
<input type="email" name="email" placeholder="Email" required>
<input type="password" name="password" placeholder="Password" Form Handling:
required> Form handling refers to the process of receiving and processing data
<button type="submit">Log in</button> entered by users in a web form. Web forms are used to collect data from
</form> users, such as their name, email, address, and other information. Once the
user submits the form, the data is sent to the web server, which processes
<?php it and takes appropriate action. Form handling is used to create interactive
if (isset($error)) { web pages, such as registration pages, contact forms, and survey forms.
echo "<p>$error</p>"; Authentication by IP address and Domain: In some rare instances, we may wish
} to limit access to a certain page or pages to certain IP addresses. It may be
?> because we have an internal network that has a publicly viewable websites. We
Server – side code to insert data in the database. may wish to have certain ages be viewable only by certain machines on internal
network.Or it may be that we have our own remote website, and we wish to
$servername = "localhost"; restrict access to a certain page or pages so that only we, from a static IP address,
$username = "username"; can access those pages.These methods work by determining the IP addresses of
$password = "password"; the user trying to view the pages and checking it against a set value. If the IP
$dbname = "myDB"; address matches, then the page can be viewed.This method could be fooled by IP
$conn = new mysqli($servername, $username, $password, $dbname); spoofing or other hacks, and should not be used to protect sensitive information,
if ($conn->connect_error) { such as credit card numbers, proprietary information, or the like/it is simple
die("Connection failed: " . $conn->connect_error); } method that can protect pages from the major users surfing the net.When using
this script, we should be aware that our computer may have more than one IP
$sql = "INSERT INTO MyGuests (firstname, lastname, email) VALUES (?, ?, address and that the one your browser is responding to the script may not be the
?)"; same one we are attempting to verify against. This is especially true when the
$stmt = $conn->prepare($sql); browser and web server resides on the same machine, as we will probably
$stmt->bind_param("sss", $firstname, $lastname, $email); encounter when testing the script.For example, computers have default local IP
$firstname = "John"; 127.0.0.1, otherwise known as “localhost’. When we start up the web server and
$lastname = "Doe"; type in http://localhost, our browser is telling the script that we are at IP address
$email = "[email protected]"; of 127.0.0.1. if we type the IP address as 192.168.0.1, our browser reports that
$stmt->execute(); we at 192.168.0.1, but the script only accept the IP of 127.0.0.1. if we run into
problems, try echoing the value of $REMOTE_ADDR to screen to see which IP
echo "New record created successfully";
$stmt->close();
$conn->close();

about:blank 2/2

You might also like