Help with PHP Code for LeapYear

Started on the old forum in October 2011 · view the original in the archive · old links redirect here

No replies · 289 views · started 15 years ago · 1 min read

K9 Conceptz Newbie · 3 posts #1

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
$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";
}
?>

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close