Std 12th IT Subject - Skill Oriented Practical (Science Stream)
The program should include the following:
<!DOCTYPE html>
<html>
<head>
<title>SOP 1: Check Eligibility</title>
</head>
<body>
<h1>PHP Program to check if a person is eligible to vote</h1>
<form method="POST" action="">
Enter Age: <input type="Number" name="Age">
<input type="Submit" value="Check Eligibility">
</form>
<?php
function checkeligibility($age)
{
if($age>=18)
{
echo "<br>You are Eligibile to vote";
}
else
{
echo "<br>You are not Eligibile to vote";
}
}
if(isset($_POST["Age"])){
checkeligibility($_POST["Age"]);
}
?>
</body>
</html>