Hi guys.
I have already installed fullcalendar successfully onto my webpage
home.php
<script type="text/javascript" src="js/fullcalendar.js"></script>
<script type="text/javascript" src="js/fullcalendar.min.js"></script>
<script>
$(document).ready(function() {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar(
{
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
editable :true,
events: "home.php",
});
})
</script>
now what i want to do is get data from my database and display it in the calendar(according to the proper dates of course). the inserted data is done in another page
event.php
<?php
if(isset($_POST['submit']))
{
$name = mysql_real_escape_string($_POST['ename']);
$date = mysql_real_escape_string($_POST['edate']);
$time = mysql_real_escape_string($_POST['etime']);
$venue = mysql_real_escape_string($_POST['evenue']);
if(preg_match('/^[a-zA-Z0-9\s]+$/', $name))
{
require "connection.php";
$event = mysql_query("INSERT INTO event VALUES('','$name','$date','$time','$venue')") or die(mysql_error());
}
}
?>
<html>
<body>
<form name="create" method="post" action="event.php">
<fieldset>
<legend>Create an Event</legend>
<p>Event Name : <input type="text" name="ename" required/></p>
<p>Event Date : <input type="text" id="datepicker" name="edate" required/></p>
<p>Event Time : <input type="time" name="etime" required/></p>
<p>Event Venue : <input type="text" name="evenue" required/></p>
<input type="submit" name="submit" value="Create Event" /><input type="submit" id="cancel" name="cancel" value="Cancel" />
</fieldset>
</form>
</body>
</html>
Ive tried some tutorials i found on the web but i keep getting
{"event_id":"6","event_name":"Open Rodeo","event_date":"05\/08\/2014"}
at the top of the page and my fullcalendar is just empty.
help please!