title: How to echo out to user if date is equal to their birthday?
body: <p>so for one of my school assignments I've been having troubles echoing out to the user after they have inputed their birthday. I have to echo out to the user 2 ways. 1) if the date equals their birthday they get a nice message, and 2) if the date does NOT equal their birthday then they get a different message.</p>
  
  <p>For some reason my if statement isn't working... Help?</p>
  
  <p>Here's the if statement........</p>
  
  <pre><code>&lt;?php    
  
  //if statement for birthday
  $month = $_POST['month'];
  $year = $_POST['year'];
  $day = $_POST['day'];
  
  $date = $year ."-". $month ."-".$day;
  
  $date = date("Y-m-d",strtotime($date));
  
  if(date('m-d') == date('m-d', $date)) {
      // today is users birthday. show any message you want here.
      echo "&lt;p&gt;Happy Birthday $firstname!&lt;/p&gt;\n";
   } else {
      echo "&lt;p&gt;You were born $date.&lt;/p&gt;\n";
   }
  
  ?&gt;
  </code></pre>
  
  <p>And... Here's the drop down lists....</p>
  
  <pre><code>&lt;?php
              $months = array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
  
              //1950 is standard year thing for most websites I've noticed
              $yearFrom = 1950; // The first year included in the drop-down for years
  
  
              // $yearFrom = date("Y")-80; 
              // Using this line instead, gives a dynamic range of years, always 80 years
              // Echo out all years via a for-loop
              //&lt;select&gt; IS the dropdown box
              echo "&lt;select name=\"year\" id=\"year\"&gt;";
              //less than or equal to current year
              for ($yearFrom; $yearFrom &lt;= date("Y"); $yearFrom++) {
                      // Each $yearFrom represents a year, always incremented by 1 year
                      //echos out every year that we put present.......
                      echo "&lt;option value=\"$yearFrom\"&gt;$yearFrom&lt;/option&gt;";
              }
              echo "&lt;/select&gt;";
  
  
              // Echo out all months from the array $months
              echo "&lt;select name=\"month\" id=\"month\"&gt;";
              foreach($months as $key=&gt;$value) {
                      // $key is the index of the array, starting at 0
                      $numericMonth = $key + 1;
                      echo "&lt;option value=\"$numericMonth\"&gt;$value&lt;/option&gt;";
              }
              echo "&lt;/select&gt;";
  
  
              // Echo out all days (1-31) via a for-loop
              echo "&lt;select name=\"day\" id=\"day\"&gt;";
              for ($i=1; $i &lt;= 31; $i++) {
                      // Each $i represents a numeric value of days, from 1-31
                      echo "&lt;option value=\"$i\"&gt;$i&lt;/option&gt;";
              }
              echo "&lt;/select&gt;";
  
              ?&gt;
  </code></pre>
  
  <p>So... Thats what I have.. All ideas and assistance is greatly appreciated. :)</p>