Hi, I realise that this is a newbie question but I only started PHP at college last week.
I need to create a form where the user inputs a month of the year and the form outputs the number of days in that month.
My current code says that there are 31 days in every month..
Here is what I have for the form, this part is working fine
<form name="months" method="post" action="Task2Algorithm1.php">
Enter Month <input name="month" ><br>
<button type="submit" style="float:left">Submit</button>
</form>
And here is the code for the form, dreamweaver is saying there are no syntax errors but it still isn't working because it says there are 31 days in each month, so I have no idea.
<?php
$month=$_POST['month'];
if ($month == "January" OR "March" OR "May" OR "July" OR "August" OR "October" OR "December")
{
echo "The number of days in this month is 31";
}
elseif ($month == "April" OR "June" OR "September" OR "November")
{
echo "The number of days in this month is 30";
}
elseif ($month == "February")
{
echo "The number of days in this month is 28";
}
?>
Any suggestions would be GREATLYYY appreciated