title: Can't access data in php file sent via jquery ajax
body: <p>I am trying to access some data in php file sent via jquery ajax method
  but I get an error of Undefined Index.</p>
  <p>sender.php</p>
  <pre><code>$('#slot1').click(function(){
              var selectedDate = $('#selectedDate').html();
              var timeSlot = $('#timeSlot1').html();
  
              var hm = timeSlot.slice(0, 5);
              var seconds = ':00';
              var time = hm + seconds;
              $.ajax({
                url: 'insertBookings.php',
                type: 'post',
                data: {date: selectedDate, timeslot: time},
                async: false,
                success: function(data) {
                  alert(data);
                }
              })
  })
  </code></pre>
  <p>reciver.php</p>
  <pre><code>&lt;?php
  $date = $_POST['date'];
  echo date;
  ?&gt;
  </code></pre>