Help with PHP Code for LeapYear

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help with PHP Code for LeapYear

    Hi, I have trouble with my leap year script using PHP, it's not working...Here is the code below:

    index.html

    <html>
    <body>
    <form action:"leapyear.php" method="POST">
    <table>
    <tr>
    <td>Enter a year:</td><td><input type="text" name="txtenter">
    </tr>
    <tr>
    <td><input type="submit" value="Determine"></td>
    <td><input type="reset" value="clear"></td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    leapyear.php

    PHP Code:
    <?php
    $year
    =$_POST["txtenter"]
    if ((
    $year%4)==0.&&($year%100)!=0)
    {
    echo 
    "The Year $year is a leap year";
    else if ((
    $year%4)==0.&&($year%400)==0)
    {
    echo
    "The Year $year is a leap year";
    }
    else
    {
    echo 
    "Year is %year is not a leap year";
    }
    ?>
Working...
X