Vocational Program Admission Application Form
Vocational Department Admission Form
Full Name
Date of Birth
Gender — Select Gender — Male Female Other
Email Address
Phone Number
Address
Select Course — Select Course — Computer Applications Fashion Designing Tourism & Hospitality Electronics
Upload Documents (PDF/Images)
Submit ApplicationHTML Web Page Structure
HTML documents follow a standard structure that web browsers understand:
| Element | Description |
|---|---|
<!DOCTYPE html> | Declares the document type and version of HTML. Required at the top. |
<html lang="en"> | Root element of the page. The lang attribute defines the language. |
<head> | Contains meta-information about the page (not shown directly to users). |
<meta charset="UTF-8"> | Sets the character encoding. UTF-8 supports most characters. |
<title> | Sets the title of the page (shown in the browser tab). |
<body> | Contains the visible content of the webpage like text, images, buttons, etc. |
Example of a basic HTML document:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My First Web Page</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>Hello! This is a simple web page created using HTML.</p>
<ul>
<li>Home</li>
<li>About</li>
<li>Contact</li>
</ul>
</body>
</html>Ordered Lists in HTML
An ordered list in HTML is used to display a list of items in a specific sequence or order, typically numbered. Ordered lists are created using the <ol> tag, with each list item wrapped in <li> (list item) tags.
Syntax Example
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>Key Attributes for Ordered Lists
type– Specifies the numbering style:type="1"– Default (Arabic numerals: 1, 2, 3)type="A"– Uppercase letters (A, B, C)type="a"– Lowercase letters (a, b, c)type="I"– Uppercase Roman numerals (I, II, III)type="i"– Lowercase Roman numerals (i, ii, iii)
start– Specifies the starting number/letter:start="5"– Begins numbering from 5- Works with all
typevalues
reversed– Counts backwards (HTML5):reversed– No value needed, just include the attribute
Conditional Statements in PHP
Conditional statements allow you to execute different blocks of code based on specific conditions. In PHP, you can use if, else, elseif, and switch statements to control the flow of your program depending on whether a condition is true or false.
1. if Statement
The if statement is used to execute a block of code if a condition is true.
<?php
$age = 18;
if ($age >= 18) {
echo "You are eligible to vote.";
}
?>2. The else Statement
The else statement is used when the if condition is false. If the condition inside if is not met, the code inside else will be executed.
3. The elseif Statement
The elseif statement allows you to check multiple conditions. It’s used when you have more than two conditions to test.
<?php
if ($age < 13) {
echo "You are a child.";
} elseif ($age >= 13 && $age < 18) {
echo "You are a teenager.";
}
?>4. The switch Statement
The switch statement is used to perform different actions based on different conditions. It’s often used when you have multiple possible values for a single variable.
PHP Cookies
A cookie is a small piece of data stored on the client’s browser (the user’s device) that is sent back to the server with every request. Cookies are typically used for storing information such as:
- User preferences
- Session IDs
- Login details, etc.
In PHP, we can create a cookie using the setcookie() function:
setcookie(name, value, expire, path, domain, secure, httponly);
Parameters Explained
- Name – The name of the cookie (required)
- Value – The value of the cookie (optional)
- Expire – When the cookie expires (UNIX timestamp)
- Path – The path on the server where the cookie is available
- Domain – The domain where the cookie is available
- Secure – If TRUE, only transmitted over HTTPS
- HttpOnly – If TRUE, only accessible through HTTP protocol
Variables in PHP
A variable in PHP is used to store data that can be referenced and manipulated. Variables are essentially containers for values, such as strings, integers, floats, or arrays. In PHP, variables are denoted by a dollar sign ($) followed by the name of the variable.
PHP supports several data types, and the type of variable is determined by the value assigned to it. Some common types are:
- String: A sequence of characters.
Example:$name = "John"; - Integer: Whole numbers (positive or negative).
Example:$age = 25; - Float (or Double): Numbers with decimal points.
Example:$height = 5.9; - Boolean: Represents
trueorfalse.
Example:$is_student = true; - Array: A collection of values stored in a single variable.
Example:$colors = ["red", "green", "blue"]; - Object: An instance of a class (used in Object-Oriented Programming).
Example:$person = new Person(); - NULL: Represents an empty or uninitialized variable.
Example:$var = NULL;
PHP Control Structures
Control structures in PHP allow you to control the flow of your program, enabling it to make decisions, repeat actions, and manage logic based on certain conditions. PHP provides several control structures, including:
1. Conditional Statements: Conditional statements allow you to make decisions and execute different blocks of code depending on whether a given condition evaluates to true or false.
2. Loops: Loops are used to execute a block of code repeatedly under certain conditions: for loop, while loop, do-while loop.
The foreach loop is specifically used to iterate over arrays. It is ideal for looping through all elements in an array (indexed or associative).
3. Jump Statements: Jump statements allow you to control the flow of execution in loops or conditional blocks. These include break, continue, and goto.
breakto exit a loop or switch.continueto skip the current iteration in a loop.gototo jump to a specific part of the code (less common).
PHP Error Types
A syntax error occurs when there is a mistake in the syntax of the PHP code. This type of error prevents PHP from interpreting the script properly.
- Syntax Errors (Parse Errors): Errors in the code structure, often due to missing semicolons, parentheses, or brackets.
- Runtime Errors: Errors that occur when the script is running, often due to calling undefined functions or classes.
- Fatal Errors: Errors that stop the script from executing (e.g., including a non-existent file).
- Warning Errors: Non-fatal errors that don’t stop script execution but alert the developer to potential issues (e.g., trying to open a non-existent file).
- Notice Errors: Informational errors that don’t stop script execution (e.g., using uninitialized variables).
- Deprecated Errors: Warnings about functions or features that are outdated and will be removed in future versions of PHP.
- Exceptions: Custom error handling mechanism that allows you to catch and handle errors in a more controlled way.
WAP to check whether the given number is prime or not
// Check for factors from 2 to the square root of the number
for ($i = 2; $i <= sqrt($num); $i++) {
// If num is divisible by any number between 2 and sqrt(num), it's not prime
if ($num % $i == 0) {
return false;
}
}
// If no factors were found, the number is prime
return true;
Write a PHP script that finds out the sum of first n odd numbers.
// Assume $n and $sum are initialized, and $oddNumber starts at 1
for ($i = 1; $i <= $n; $i++) {
$sum += $oddNumber;
$oddNumber += 2; // Move to the next odd number
}
return $sum;
