Jump to content

JamesUK91

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

JamesUK91's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ahhhhh thanks so much guys you're lifesavers
  2. 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
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.