Awp
Awp
Awp
1. Answer All:
a. What is an Anchor tag in HIML?
Ans: - An anchor tag in HTML is a markup element used to create a
hyperlink to another webpage or a specific location within the same
webpage.
b. How is Cell Padding different from Cell Spacing?
Ans: - Cell padding refers to the space between the cell content and the
cell border in a table, while cell spacing refers to the space between
adjacent cells in a table.
c. What is HTML frameset?
Ans: - HTML frameset is a deprecated HTML element that was used to
divide a web page into multiple sections or frames, each with its own
HTML document.
d. What is the difference between class selector and id selector in CSS?
Ans: - Class selectors are used to apply styles to multiple elements with
the same class attribute, while ID selectors are used to apply styles to a
single element with a unique ID attribute.
e. What is inline, embedded and external Style Sheet.
Ans: - Inline, embedded, and external style sheets are different ways to
define styles for HTML elements in web pages. Inline styles are defined
within the HTML element using the "style" attribute. Embedded styles are
defined in the head section of the HTML document using the "style" tag.
External styles are defined in a separate CSS file and linked to the HTML
document using the "link" tag.
f. What are dialog boxes in JavaScript?
ANS: - Dialog boxes in JavaScript are modal windows that display
messages or prompt users for input. They include alert boxes,
confirmation boxes, and prompt boxes.
g. What is the use of "isset" in PHP?
Ans: - "isset" is a function in PHP used to check if a variable is set and not
null. It returns true if the variable is set and not null, and false otherwise.
h. What are different output functions in PHP?.
Ans: - Some common output functions in PHP are "echo", "print", and
"print". "Echo" and "print" are used to output strings, while "print" is used to
format and output strings according to a specified format.
i. What is the difference between $ GET and $ POST in PHP?
Ans: - $GET and $POST are both super global arrays in PHP used to
retrieve data from HTML forms. $GET retrieves data using the GET
method, which appends form data to the URL. $POST retrieves data using
the POST method, which sends form data in the request body.
j. What is the difference between array slice and array _combine in PHP?
Ans: - "array_slice" is a function in PHP used to extract a slice of an array.
It takes an array and two indices as parameters and returns a new array
containing the elements between the two indices. "array_combine" is a
function used to create an associative array from two arrays, where one
array contains the keys and the other contains the values.
PART - B
2. Write HTML and Java Script code to design a registration page and validate
all the fields using Java Script.
ANS: -
This code creates a simple registration form with fields for Name, Email, Phone
Number, Password, and Confirm Password. The JavaScript code includes a
function to validate the form fields and ensure that all required fields are filled
out, the password matches the confirm password, and the phone number and
email address are in valid formats. The function is triggered when the Submit
button is clicked.
3. What is Event? Explain some keyboard events in Java Script by giving a
suitable example.
Ans:- In JavaScript, an event is an action that occurs as a result of user
interaction with a webpage or browser. There are several keyboard events
that can be used in JavaScript, including:
keydown: triggered when a key is pressed down
keyup: triggered when a key is released
keypress: triggered when a key is pressed down and released
4. Write code to explain the use of inline, embedded and external Style Sheet.
Ans :- Inline Styles:
Inline styles are styles that are directly applied to an HTML element using the
"style" attribute. The following code example demonstrates how to use inline
styles to set the background color of a paragraph element to blue:
Changing session data: To change session data, simply assign a new value to a
session variable:
Destroying a session: To destroy a session and remove all session data, use
the "session_destroy()" function:
Pass by value:
In PHP, variables are typically passed to functions by value. This means that
the function receives a copy of the variable's value, rather than a reference to
the variable itself. Changes made to the variable within the function will not
affect the original variable outside of the function.
Example:
<?php
function addOne($x) {
$x = $x + 1;
return $x;
}
$a = 5;
echo addOne($a); // Output: 6
echo $a; // Output: 5
?>
Ecample 2
<?php
function calculate(&$a1){
$a1++;
}
$a1=5;
echo "This is the value of a1 variable before the function
call :: ";
echo $a1;
echo "<br>";
echo "This is the value of a1 variable after the function
call :: ";
calculate($a1);
echo $a1;
?>
8. Write short notes on any Two:-
a) PHP Datatype:
PHP data types are used to hold different types of data or values. PHP supports 8
primitive data types that can be categorized further in 3 types:
1. boolean
2. integer
3. float
4. string
PHP Data Types: Compound Types
It can hold multiple values. There are 2 compound data types in PHP.
1. array
2. object
1. resource
2. NULL
An HTML form facilitates the user to enter data that is to be sent to the server
for processing such as name, email address, password, phone number, etc. .
d) HTML DOM
It is a programming interface for web documents that allows
JavaScript to manipulate the HTML and CSS content of a
webpage. The DOM represents the structure of an HTML
document as a tree-like hierarchy of nodes, with each node
representing an HTML element, attribute, or text content.
1. Accessing HTML elements - We can use methods like getElementById() ,
getElementsByClassName() , and getElementsByTagName() to access specific HTML
elements within the DOM.