Web Tech ALL
Web Tech ALL
1. $_SERVER['PHP_SELF']
2. $_SERVER['SERVER_NAME']
3. $_SERVER['HTTP_HOST']
4. $_SERVER['REQUEST_METHOD']
f) Whether root element is required for XML file? If so, how many root elements are
required?
Yes, one root element is required.
o) What is DOM?
The Document Object Model (DOM) is a programming interface that allows scripts to update
content, structure, and style of documents.
q) What is jQuery?
jQuery is a fast, lightweight JavaScript library for DOM manipulation, animations, event
handling, and AJAX interactions.
r) What is CodeIgniter?
CodeIgniter is a lightweight PHP framework based on the MVC architecture.
u) Which function is used to print an error message and exit from current code?
die() or exit()
x) What is DOM?
The Document Object Model (DOM) is an interface that represents HTML or XML
documents as a tree structure, enabling manipulation via scripting languages.
z) What is jQuery?
jQuery is a fast, lightweight JavaScript library for simplifying HTML DOM manipulation,
animations, and AJAX calls.
c) What is CodeIgniter?
CodeIgniter is a PHP framework that follows the MVC architecture for rapid web application
development.
Q2. TWO MARKS QUESTIONS
a) List any four datatypes that JavaScript supports with its usage.
● Start Session:
session_start();
● Destroy Session:
session_destroy();
● User interface
● AJAX Engine (XMLHttpRequest)
● Server-side components (Database/Business Logic)
d) What is MVC?
Similarities Differences
Both are used to send form data to GET appends data to URL, POST sends data in
server. request body.
Both use HTTP protocol. GET has size limit (about 2000 characters), POST
has no limit.
Both can use $_REQUEST to GET is less secure (visible in URL), POST is more
access data. secure.
Both can send text data. POST supports binary data (files upload), GET does
not.
● In asynchronous mode, the browser does not wait for a response from the server.
● The user can continue interacting with the page while the request is processed in the
background.
● Example: Fetching suggestions in a search bar.
GET POST
Element Description
Q3. FOUR MARKS QUESTIONS
● The confirm() method displays a dialog box with a message, an OK button, and a
Cancel button.
● It returns true if OK is clicked and false if Cancel is clicked.
● It is used to confirm user actions, such as deleting records.
Example:
var result = confirm("Are you sure you want to delete this record?");
if(result) {
alert("Record Deleted");
} else {
alert("Action Cancelled");
Explanation:
Technique Description
Cookies Small data stored in user's browser and sent with each request.
Sessions Data stored on server, identified via session ID sent as cookie or in
URL.
<html>
<head>
<script>
function showCountries() {
xhr.onreadystatechange = function() {
document.getElementById("result").innerHTML = xhr.responseText;
xhr.send();
</script>
</head>
<body>
<button onclick="showCountries()">OK</button>
<div id="result"></div>
</body>
</html>
→
<?php
?>
b) Design HTML form to accept Employee name, Age, Mobile no. & perform
validations using JavaScript.
→
<!DOCTYPE html>
<html>
<body>
</form>
<script>
function validateForm() {
return false;
}
if(mobile.length != 10 || isNaN(mobile)) {
return false;
return true;
</script>
</body>
</html>
var x = xmlDoc.getElementsByTagName("book")[0];
x.setAttribute("category", "food");
XML Parser: A tool to read, process, and convert XML into readable data for applications.
Types:
Parser Description
DOM Parser Loads entire XML into memory as tree structure (read/write).
SAX Parser Reads XML sequentially without loading into memory (read-only).
Step Description
Component Description
alert("Name is required.");
} else {
}
b) AJAX program for Doctor table (dno, dname, experience).
</select>
<div id="details"></div>
<script>
function getDoctorDetails() {
xhr.onreadystatechange = function() {
document.getElementById("details").innerHTML = xhr.responseText;
xhr.send();
</script>
doctorDetails.php:
$doctors = [
];
$dno = $_GET['dno'];
if(isset($doctors[$dno])) {
}
c) PHP script for session-based page access count.
<?php
session_start();
if(!isset($_SESSION['count'])) {
$_SESSION['count'] = 1;
} else {
$_SESSION['count']++;
?>
Field Description
if(name) {
if(confirmStudy) {
} else {
} else {
alert("Name is required!");
}
b) PHP + jQuery to append paragraph and ordered list items.
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
$("#addPara").click(function() {
});
$("#addList").click(function() {
$("ol").append("<li>New Item</li>");
});
});
</script>
</head>
<body>
<p>Paragraph Text</p>
<ol><li>Item 1</li></ol>
</body>
</html>
Q4. THREE MARKS QUESTIONS
→
XML Parser: An XML parser is a tool that reads, processes, and extracts data from XML
documents.
Types:
Type Description
DOM Loads entire XML document into memory as a tree structure, allows read &
Parser write operations. Suitable for small XML files.
SAX Processes XML data sequentially, does not load the entire document into
Parser memory. Suitable for large XML files, read-only.
→
Steps:
Example:
jQuery selectors are used to select and manipulate HTML elements using CSS-like
syntax.
Types: