Short Answers
Short Answers
A variable in PHP is a named container used to store data like numbers, strings, or arrays. It
begins with a dollar sign $, followed by the variable name.
Example:
$name = "Nutan";
$age = 21;
A form is used to collect user input from a web page. It allows interaction between the user
and the server (e.g., submitting login details, feedback, etc.).
$_GET
$_POST
$_REQUEST
$_SERVER
$_FILES
$_SESSION
$_COOKIE
$_ENV
$GLOBALS
GET: Sends data via the URL. Used for simple queries (e.g., search).
POST: Sends data in the request body. Used for secure or large form data (e.g.,
passwords, file uploads).
The file used is php.ini, which controls settings like error reporting, upload limits, and
default timezone.
The error_log() function is used to log error messages to a file or system log, helping
developers debug applications.
The header() function sends raw HTTP headers. It’s used to:
A cookie is a small piece of data stored on the client’s browser, used to remember
information across page requests.
Example:
An error is a mistake in the script that can stop the execution or cause incorrect output.
Types include syntax errors, runtime errors, and logical errors.
Cookies
Sessions
Hidden form fields
URL parameters (Query Strings)
1. What is XML?
XML (eXtensible Markup Language) is a markup language designed to store and transport
data in a human-readable and machine-readable format. It focuses on data structure and
sharing across different systems.
2. What is SimpleXML?
SimpleXML is a PHP extension that allows easy and efficient manipulation of XML data. It
provides an object-oriented way to read, traverse, and edit XML documents with less code.
5. What is CDATA?
CDATA (Character Data) is a section in XML where characters are not parsed by the
parser. It’s used to include special characters (like <, &, etc.) without them being treated as
markup.
Example:
XML declaration
Root element
Nested child elements with data
Example:
<?xml version="1.0"?>
<book>
<title>Web Tech</title>
<author>Nutan</author>
</book>
An XML parser is a program or library that reads XML data and makes it accessible to
programming languages. It checks for well-formedness and sometimes validity of the XML.
9. Define DOM.
DOM (Document Object Model) is a way to represent XML as a tree structure where
every node is an object. Using DOM, developers can navigate, modify, and manipulate the
XML structure programmatically.
XML Declaration
Root Element
Child Elements
Attributes
Text Content
CDATA Sections
Comments
Processing Instructions
1. What is JavaScript?
3. What is jQuery?
jQuery is a fast, small, and feature-rich JavaScript library that simplifies HTML DOM
manipulation, event handling, animations, and Ajax interactions.
4. Enlist any two features of jQuery.
Cross-browser compatibility
Simplified DOM traversal and manipulation
String
Number
Boolean
Object
Undefined
Null
Symbol (ES6)
BigInt (ES11)
The switch statement is used to execute different blocks of code based on the value of a
variable or expression.
function greet() {
alert("Hello!");
}
Events are actions that occur in the browser, like clicks, keypresses, form submits, etc.,
which can be handled using JavaScript.
Popup boxes are used to display messages or get input from users.
Types: alert(), confirm(), prompt()
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function(){
$("p").hide();
});
</script>
AJAX is a technique for creating fast and dynamic web pages by updating parts of a web
page without reloading the whole page.
The XMLHttpRequest object is used to exchange data with a server behind the scenes.
It allows:
Example:
5. What is Sajax?
Sajax (Simple Ajax Toolkit) is an open-source tool to simplify AJAX calls in web
applications.
Sajax reduces the complexity of writing raw AJAX code by offering ready-to-use functions.
3. Define MVC.
MVC stands for Model-View-Controller:
5. Which three components are the pillars for CodeIgniter application architecture?
The three main pillars of CodeIgniter architecture are:
Model
View
Controller
These follow the MVC design pattern.
7. What is helper?
A helper in CodeIgniter is a file containing a collection of procedural functions that assist in
performing specific tasks (like working with URLs, forms, text, arrays, etc.). Unlike libraries,
helpers are not object-oriented and don’t require instantiation.
8. What is cookie?
A cookie is a small piece of data stored on the client’s browser by the server. It is used to
remember information like user preferences, session identifiers, or tracking data across
requests or visits to a website.