(year.html) //inputting purpose
<html>
<form method="POST" action="leap.php">
Enter Year:<input type="number" name="n1"><br>
<input type="submit" value="submit">
</html>
Now embed the php file into the form tag
<?php
$year=$_POST["n1"];
if($year%4==0)
echo "its a leap year";
else
echo "its not a leap year";
?>
Comments
Post a Comment