title: JavaScript Calender is not working
body: <p>I am trying to make a calender using php according to a video tutorial from youtube. I m doing just what they do but there is a difference from their table.I can't find my mistake...any body help please....give the code and the picture of this....</p>
  
  <p>This is my calender-</p>
  
  <p><a href="https://i.stack.imgur.com/zAW7h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zAW7h.png" alt="calender"></a></p>
  
  <p>This is the tutorial calender-</p>
  
  <p><a href="https://i.stack.imgur.com/zAW7h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UxjlE.png" alt="calender"></a></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Calender&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;?php
          if(isset($_GET['day']))
          {
              $day = $_GET['day'];
          }else
          {
              $day = date("j");
          }
  
          if(isset($_GET['month']))
          {
              $month = $_GET['month'];
          }else{
              $month = date("n");
          }
  
          if(isset($_GET['year']))
          {
              $year = $_GET['year'];
          }else{
              $year = date("Y");
          }
  
          //calender variable----------- 
          $currentTimeStamp = strtotime($year-$month-$day);
          $monthName = date("F",$currentTimeStamp);
          $numDays = date("t",$currentTimeStamp);
          $counter = 0;
      ?&gt;
  
  
      &lt;table border = "1"&gt;
          &lt;tr&gt;
              &lt;th&gt;&lt;input  style = "width : 50px"type = "button" value = "&lt;" name = "prevbutton"&gt;&lt;/input&gt;&lt;/th&gt;
              &lt;th colspan = "5"&gt;&lt;?php echo $monthName.", ".$year?&gt;&lt;/th&gt;
              &lt;th&gt;&lt;input style = "width : 50px" type = "button" value = "&gt;" name = "nextbutton"&gt;&lt;/input&gt;&lt;/th&gt;
          &lt;/tr&gt;
  
          &lt;tr&gt;
              &lt;td width = "50px"&gt;Sun&lt;/td&gt;
              &lt;td width = "50px"&gt;Mon&lt;/td&gt;
              &lt;td width = "50px"&gt;Tue&lt;/td&gt;
              &lt;td width = "50px"&gt;Wed&lt;/td&gt;
              &lt;td width = "50px"&gt;Thu&lt;/td&gt;
              &lt;td width = "50px"&gt;Fri&lt;/td&gt;
              &lt;td width = "50px"&gt;Sat&lt;/td&gt;
          &lt;/tr&gt;
  
          &lt;?php
              echo "&lt;tr&gt;";
                  for($i = 1;$i&lt;$numDays+1;$i++,$counter++)
                  {
                      $timeStamp = strtotime($year-$month-$i);
                      if($i == 1)
                      {
                          $firstDay = date('w', $timeStamp);
                          for($j = 0;$j&lt;$firstDay;$j++,$counter++)
                          {
                              echo "&lt;td&gt;&amp;nbsp&lt;/td&gt;"; 
                          }
                      }
                      if($counter%7==0)
                      {
                          echo "&lt;/tr&gt;&lt;tr&gt;";
                      }
                  }
              echo "&lt;/tr&gt;";
          ?&gt;
  
      &lt;/table&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>