title: Post not working in Ajax to save the input to database
body: <p>I am trying to save an event via ajax on the full calendar.</p>
  
  <p>I have tested the php for inserting the events and it is working fine. So I realized that the events are not being passed via ajax.</p>
  
  <p>They are not being passed for insertion or updatation.</p>
  
  <pre><code>&lt;script&gt;
  
  $(document).ready(function() {
     var date = new Date();
     var d = date.getDate();
     var m = date.getMonth();
     var y = date.getFullYear();
  
     var calendar = $('#calendar').fullCalendar({
      editable: true,
      header: {
      left: 'prev,next today',
      center: 'title',
      right: 'month,agendaWeek,agendaDay'
     },
  
    events: "events.php",
  
     // Convert the allDay from string to boolean
     eventRender: function(event, element, view) {
     if (event.allDay === 'true') {
        event.allDay = true;
     } else {
       event.allDay = false;
      }
   },
    selectable: true,
    selectHelper: true,
    select: function(start, end, allDay) {
    var title = prompt('Event Title:');
    var url = prompt('Type Event url, if exits:');
    if (title) {
      var start = $.fullCalendar.moment(start);
      var end = $.fullCalendar.moment(end);
    $.ajax({
       url: 'add_events.php',
       data: 'title='+ title+'&amp;start='+ start +'&amp;end='+ end +'&amp;url='+ url ,
       type: "POST",
       success: function(json) {
       alert('Added Successfully');
      }
     });
     calendar.fullCalendar('renderEvent',
    {
     title: title,
     start: start,
     end: end,
     allDay: allDay
    },
    true // make the event "stick"
    );
   }
    calendar.fullCalendar('unselect');
   },
  
   editable: true,
   eventDrop: function(event, delta) {
   var start = $.fullCalendar.moment(event.start);
   var end = $.fullCalendar.moment(event.end);
   $.ajax({
     url: 'update_events.php',
     data: 'title='+ event.title+'&amp;start='+ start +'&amp;end='+ end +'&amp;id='+ event.id ,
     type: "POST",
     success: function(json) {
     alert("Updated Successfully");
     }
   });
   },
   eventResize: function(event) {
   var start = $.fullCalendar.moment(event.start);
   var end = $.fullCalendar.moment(event.end);
    $.ajax({
     url: 'update_events.php',
     data: 'title='+ event.title+'&amp;start='+ start +'&amp;end='+ end +'&amp;id='+ event.id ,
    type: "POST",
    success: function(json) {
    alert("Updated Successfully");
    }
   });
  
   }
  
   });
  
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Here is the insertion code (add_events.php)</p>
  
  <pre><code> $title = $_POST['title'];
   $start = $_POST['start'];
   $end = $_POST['end'];
   $url = $_POST['url'];
  
  
  // connection to the database
  try {
    $bdd = new PDO('mysql:host=localhost;dbname=fullcalendar', 'umar', 'Umar@295');
   } catch(Exception $e) {
     exit('Unable to connect to database.');
   }
  
   // insert the records
     $sql = "INSERT INTO evenement (title, start, end, url) VALUES (:title, :start, :end, :url)";
  
     $q = $bdd-&gt;prepare($sql);
     $q-&gt;execute(array(':title'=&gt;$title, ':start'=&gt;$start, ':end'=&gt;$end,  ':url'=&gt;$url));
  </code></pre>
  
  <p>And here is the update_events for updating the event :</p>
  
  <pre><code> /* Values received via ajax */
   $id = $_POST['id'];
   $title = $_POST['title'];
   $start = $_POST['start'];
   $end = $_POST['end'];
  
   // connection to the database
   try {
     $bdd = new PDO('mysql:host=localhost;dbname=fullcalendar', 'umar', 'Umar@295');
    } catch(Exception $e) {
     exit('Unable to connect to database.');
    }
   // update the records
   $sql = "UPDATE `evenement` SET 'title'=?, 'start'=?, 'end'=? WHERE 'id'=?";
   $q = $bdd-&gt;prepare($sql);
   $q-&gt;execute(array($title,$start,$end,$id));
  </code></pre>
  
  <p>I would appreciate if someone could point me into understanding how to get the POST in the Ajax working or what I am doing wrong.</p>