PHP Program to find whether a year is LEAP year or not



PHP Program to find whether a year is LEAP year or not

<?php
if(isset($_POST['submit']))
 {
    $year=$_POST['year'];
    if($year%4==0)
          {
            $leap="It is a leap year";
          }
      else
         {
           $leap="It is not a leap year";
        }
}
 ?>
 <html>
 <head>
 <title>Leap Year</title>
 </head>
 <body>
 <table>
 <form name="frm" method="post" action="">
    <tr><td>Enter the year:</td><td><input type="text" name="year" /></td></tr>
    <tr><td></td>        <td><input type="submit" name="submit" value="submit" /></td>
    <td><center><span> 
     <?php
                     if(isset($_POST['submit'])){   
                        echo $leap;      }  
     
     ?>   
           </span></center></td></tr>
 </form>
 </table>
</body>
</html>

Post a Comment

0 Comments