HTML Program
HTML Program
INPUT:
<html>
<head>
<title>
</title>
</head>
<body bgcolor="lightgray">
<hr>
</p>
<h2><b>Courses Offered</b></h2>
<ul>
<li>Bsc Physics</li>
<li>Bsc Mathematics</li>
<li>Bsc Chemistry</li>
</ul>
minds with the ability to manage real world problem with the latest technology,
to inculcate professional behaviors, strong ethical values, innovative research capability and leadership
ability.
Help the students to explore the depths of computer science, exalt in them and at the same time join
hands with the other
branches of science to turn something virtual into real and vice versa.</p>
<ol>
<li>Mrs.Niranjana</1i>
<li>Mrs.Vishnu Priya</1i>
<li>Mrs.Dhamini</li>
</ol>
<h3>Contact as </h3>
<p>Email:[email protected]</p>
</body>
</html>
OUTPUT:
Kalaimahal College of Arts and Science
Sembanarkoil
About College
Courses Offered
Bsc Physics
Bsc Mathematics
Bsc Chemistry
To educate the young minds with the ability to manage real world problem with the latest technology, to
inculcate professional behaviors, strong ethical values, innovative research capability and leadership ability. Help
the students to explore the depths of computer science, exalt in them and at the same time join hands with the
other branches of science to turn something virtual into real and vice versa.
Mrs.Niranjana
Mrs.Vishnu Priya
Mrs.Dhamini
Contact as
Email:[email protected]
2) Write names of several countries in a paragraph and store it as an html document, world. html. Each country
name must be a hot text. When you click india (for example), it must open india.html and it should provide a
brief introduction about india. with output
INPUT:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>World Countries</title>
</head>
<body>
<p>
</p>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>About India</title>
</head>
<body>
<h1>India</h1>
<p>India is a vast South Asian country with diverse cultures, languages, and traditions. It is known for its rich
history, vibrant festivals, and iconic landmarks like the Taj Mahal.</p>
</body>
</html>
OUTPUT:
Here are some countries: India, USA, France, Japan.
India
India is a vast South Asian country with diverse cultures, languages, and traditions. It is known for its rich history,
vibrant festivals, and iconic landmarks like the Taj Mahal.
3) Develop a HTML document to i) display Text with Bullets / Numbers - Using Lists ii) to display the Tablet
Format Date.
INPUT:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Create a HTML list using JavaScript</title>
</head>
<body>
<center>
<h1>Students list</h1>
</center>
<ul id="myList"></ul>
<script>
let data = ["Pugazhenthi","Srinithya","Narmatha", "Priyanka"];
let list = document.getElementById("myList");
for (i = 0; i < data.length; ++i) {
let li = document.createElement('li');
li.innerText = data[i];
list.appendChild(li);
}
</script>
</body>
</html>
OUTPUT:
Students list
Pugazhenthi
Srinithya
Narmatha
Priyanka
4) Develop a Complete Web Page using Frames and Framesets which gives the Information about a Hospital
using HTML
INPUT:
---------------------------------------
| | |
| | |
| Frame 1 | |
| | |
| | |
|---------| |
| | Frame 3 |
| | |
| | |
| | |
| Frame 2 | |
| | |
| | |
| | |
| | |
---------------------------------------
5) Write a HTML document to print your Bio-Date in an eat format using several components
INPUT:
<html>
<head>
<title>BIODATA</title>
</head>
<marquee>
<body bgcolor="pink"><font color="black"><font size=30>Biodata</font>
</marquee>
<hr>
<body><font size=5><font color="blue">
<img src="Desert.jpg" align="right" height=50 width=50 1px>
Name:S.Nandhini<br>
Father's name:S.Selvarajan<br>
Mothers's name:S.Usha<br>
DOB:18:12:1997<br>
Address:Chennai-19<br>
Mobile no:1234566543<br>
Religion:Hindu<br>
Nationality:Indian<br>
Gender:Female<br>
Qualification:BCA<br>
<table style="width:50%"border=3>
<tr>
<th>semester</th>
<th>grade</th>
<th>cpga %</th>
</tr>
<tr>
<th>1</th>
<th>S</th>
<th>80%</th>
</tr>
<tr>
<th>2</th>
<th>A</th>
<th>78 %</th>
</tr>
</body>
</html>
OUTPUT:
BIODATA
Name : S.Nandhini
Father's name : S.Selvarajan
Mothers's name : S.Usha
DOB :18:12:1997
Address :Chennai-19
Mobile no :1234566543
Religion :Hindu
Nationality :Indian
Gender :Female
Qualification :BCA
semester grade cpga %
1 S 80%
2 A 78 %
6) Develop a html document to display a registration form for an inter-collegiate function.
INPUT:
<Html>
<head>
<title>
Registration Page
</title>
</head>
<body bgcolor="Lightskyblue">
<br>
<br>
<form>
<label> Firstname </label>
<input type="text" name="firstname" size="15"/> <br> <br>
<label> Middlename: </label>
<input type="text" name="middlename" size="15"/> <br> <br>
<label> Lastname: </label>
<input type="text" name="lastname" size="15"/> <br> <br>
<label>
Course :
</label>
<select>
<option value="Course">Course</option>
<option value="BCA">BCA</option>
<option value="BBA">BBA</option>
<option value="B.Tech">B.Tech</option>
<option value="MBA">MBA</option>
<option value="MCA">MCA</option>
<option value="M.Tech">M.Tech</option>
</select>
<br>
<br>
<label>
Gender :
</label><br>
<input type="radio" name="male"/> Male <br>
<input type="radio" name="female"/> Female <br>
<input type="radio" name="other"/> Other
<br>
<br>
<label>
Phone :
</label>
<input type="text" name="country code" value="+91" size="2"/>
<input type="text" name="phone" size="10"/> <br> <br>
Address
<br>
<textarea cols="80" rows="5" value="address">
</textarea>
<br> <br>
Email:
<input type="email" id="email" name="email"/> <br>
<br> <br>
Password:
<input type="Password" id="pass" name="pass"> <br>
<br> <br>
Re-type password:
<input type="Password" id="repass" name="repass"> <br> <br>
<input type="button" value="Submit"/>
</form>
</body>
</html>
OUTPUT:
7) using HTML form accept Customer details like Name, City, Pin Code, Phone number and E mail address
and validate the date and display appropriate messages for violations using php.
INPUT:
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["name"])) {
$nameErr = "Name is required";
} else {
$name = test_input($_POST["name"]);
if (!preg_match("/^[a-zA-Z-' ]*$/",$name)) {
if (empty($_POST["email"])) {
} else {
$email = test_input($_POST["email"]);
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
if (empty($_POST["website"])) {
$website = "";
} else {
$website = test_input($_POST["website"]);
if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?
=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$website)) {
if (empty($_POST["comment"])) {
$comment = "";
} else {
$comment = test_input($_POST["comment"]);
if (empty($_POST["gender"])) {
} else {
$gender = test_input($_POST["gender"]);
}
OUTPUT:
8) Write a program to accept two numbers n 1 and n 2 using HTML form and display the Prime
numbers between n 1 and n 2 using PHP.
INPUT :
<?php
function isPrime($n) {
if ($n == 1 || $n == 0) {
return false;
}
// Run a loop from 2 to sqrt(n)
for ($i = 2; $i <= sqrt($n); $i++) {
if ($n % $i == 0) {
return false;
}
}
return true;
}
// Driver code
$N = 50;
// Check for every number from 1 to N
for ($i = 1; $i <= $N; $i++) {
if (isPrime($i)) {
echo $i . " ";
}
}
?>
OUTPUT:
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47