0% found this document useful (0 votes)
2 views

HTML Program

The document contains several HTML examples including a college website, a country list with links, a student list using JavaScript, a frameset for a hospital, a biodata format, a registration form, customer details validation using PHP, and a prime number display using PHP. Each example demonstrates different HTML features and functionalities such as forms, lists, frames, and scripting. The document serves as a practical guide for developing various web pages and applications.

Uploaded by

sribrowsing31
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

HTML Program

The document contains several HTML examples including a college website, a country list with links, a student list using JavaScript, a frameset for a hospital, a biodata format, a registration form, customer details validation using PHP, and a prime number display using PHP. Each example demonstrates different HTML features and functionalities such as forms, lists, frames, and scripting. The document serves as a practical guide for developing various web pages and applications.

Uploaded by

sribrowsing31
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 20

1) Develop website for your college using advanced tags of HTML.

INPUT:
<html>

<head>

<title>

College Department Details

</title>

</head>

<body bgcolor="lightgray">

<h1 align="center" style="color: black;">Kalaimahal College of Arts and Science

<h2 align="center" style="color: black;">Sembanarkoil

<h3 align="center" style="color: black;">Afliated to Annamalai university

<hr>

<h2 align="center" style="color: black;">About College </h2>

<p style="font-family:courier";>Kalaimahal College is one of the premier Institution in Sembanarkoil at


Mayiladuthurai District.

</p>

<h2><b>Courses Offered</b></h2>

<ul>

<li>Bsc Computer Science</li>

<li>Bsc Physics</li>

<li>Bsc Mathematics</li>

<li>Bsc Chemistry</li>

<li>Msc Computer Science</li>

</ul>

<h2>Department of Computer Science</h2>

<p style="font-family:courier">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.</p>

<h2>Faculties of Computer Science</h2>

<ol>
<li>Mrs.Niranjana</1i>

<li>Mrs.Vishnu Priya</1i>

<li>Mrs. Sakthi Priya</1i>

<li>Mrs.Dhamini</li>

</ol>

<h3>Contact as </h3>

<p>Phone Number: 04364 283410</p>

<p>Email:[email protected]</p>

</body>

</html>
OUTPUT:
Kalaimahal College of Arts and Science

Sembanarkoil

Afliated to Annamalai university

About College

Kalaimahal College is one of the premier Institution in Sembanarkoil at Mayiladuthurai District.

Courses Offered

Bsc Computer Science

Bsc Physics

Bsc Mathematics

Bsc Chemistry

Msc Computer Science

Department of Computer Science

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.

Faculties of Computer Science

Mrs.Niranjana

Mrs.Vishnu Priya

Mrs. Sakthi Priya

Mrs.Dhamini

Contact as

Phone Number: 04364 283410

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">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>World Countries</title>

</head>

<body>

<p>

Here are some countries: <a href="india.html">India</a>, <a href="usa.html">USA</a>, <a


href="france.html">France</a>, <a href="japan.html">Japan</a>.

</p>

</body>

</html>

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<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:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"


"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>A simple frameset document</TITLE>
</HEAD>
<FRAMESET cols="20%, 80%">
<FRAMESET rows="100, 200">
<FRAME src="contents_of_frame1.html">
<FRAME src="contents_of_frame2.gif">
</FRAMESET>
<FRAME src="contents_of_frame3.html">
<NOFRAMES>
<P>This frameset document contains:
<UL>
<LI><A href="contents_of_frame1.html">Some neat contents</A>
<LI><IMG src="contents_of_frame2.gif" alt="A neat image">
<LI><A href="contents_of_frame3.html">Some other neat contents</A>
</UL>
</NOFRAMES>
</FRAMESET>
</HTML>
OUTPUT:

---------------------------------------
| | |
| | |
| 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:

// define variables and set to empty values

$nameErr = $emailErr = $genderErr = $websiteErr = "";

$name = $email = $gender = $comment = $website = "";

if ($_SERVER["REQUEST_METHOD"] == "POST") {

if (empty($_POST["name"])) {
$nameErr = "Name is required";

} else {

$name = test_input($_POST["name"]);

// check if name only contains letters and whitespace

if (!preg_match("/^[a-zA-Z-' ]*$/",$name)) {

$nameErr = "Only letters and white space allowed";

if (empty($_POST["email"])) {

$emailErr = "Email is required";

} else {

$email = test_input($_POST["email"]);

// check if e-mail address is well-formed

if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {

$emailErr = "Invalid email format";

if (empty($_POST["website"])) {

$website = "";

} else {

$website = test_input($_POST["website"]);

// check if URL address syntax is valid (this regular expression also


allows dashes in the URL)

if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?
=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$website)) {

$websiteErr = "Invalid URL";

if (empty($_POST["comment"])) {

$comment = "";

} else {
$comment = test_input($_POST["comment"]);

if (empty($_POST["gender"])) {

$genderErr = "Gender is required";

} 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

You might also like