Server-Side Scripting (PHP) 

SOP 1 : Write a PHP program to check if a person is eligible to vote or not. The program should include                    the following- 
  1.  Minimum age required for vote is 18. 
  2.  Use PHP functions. 
  3.  Use Decision making statement.
Html code
vote.html
<!DOCTYPE html>
  <head>
    <title>voter validation</title>
  </head>
  <body>
    <form  action="vote.php" method="post">
      enter age<input type="text" name="age" value="">
      <input type="submit" name="submit" value="press here">
    </form>
  </body>
</html>

PHP code
vote.php
<?php
if(isset($_POST['submit']))
{
$age=$_POST['age'];
if($age>=18)
echo "you are eligible for voting";
else
echo "you are not eligible for voting";
}
?>