I am not able to add an event to mysql database after select
<p>I am using  fullcalendar for a project.
I am not able to insert a new event into mysql database.</p>

<p>It can be done usin AJAX but I am not able to pass variables from JS to php code.</p>

<p>here it is my code:</p>

<pre><code>$(document).ready(function() {

        var date = new Date();
        var d = date.getDate();
        var m = date.getMonth();
        var y = date.getFullYear();

        var calendar = $('#calendar').fullCalendar({
            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,agendaWeek,agendaDay'
            } ,
            defaultView: 'month',
            weekends: true,
            selectable: true,
            selectHelper: false,
            allDayText: 'ore di lavoro',
            editable: true,
            theme: true,



            select: function(start, end, allDay,jsEvent,view) {

             if (view.name === "month") {

                $('#calendar').fullCalendar('gotoDate', start);
                $('#calendar').fullCalendar('changeView', 'agendaDay');


            } else {

                var title = prompt('Riparazione racchetta da tennis:');
                if (title) {  
                    calendar.fullCalendar('renderEvent',
                        {
                            title: title,
                            start: start,
                            end: end,
                            allDay: allDay
                        },
                        true // make the event "stick"


                    );
                   $.ajax({

                      type: "POST",
                      url: "kot.php",
                      data: "title=" + title + "&start=" + start + "&end=" + end,

                   });
                $('#calendar').fullCalendar('refetchEvents');   
                }
                calendar.fullCalendar('unselect');
            }
            },

             eventSources: [

        // your event source
        {
            url: 'json-events.php',
            type: 'POST',

            error: function() {
                alert('there was an error while fetching events!');
            },
            //color: 'blue',   // a non-ajax option
            //textColor: 'black' // a non-ajax option
        },

        // any other sources...
      {
            url: 'kot.php',
            type: 'POST',
            data: {
                custom_param1: 'something',
                custom_param2: 'somethingelse',
                custom_param3: 'somethingelsee'

            },
            error: function() {
                alert('there was an error while fetching events!');
            },
            color: 'yellow',   // a non-ajax option
            textColor: 'black' // a non-ajax option
        }
    ]               
        });
    });</code></pre>
