I was following the blog post about how to make an AJAX-enabled Calendar (http://keighl.com/post/expressionengine-dynamic-calendar-using-jquery/) and I faced a problem with $POST output.
I am using Solspace calendar though but the problem seems to be that the POST parameters are being sent but ain’t being output.
Here’s my page1, which sends POST request: http://vulichenko.ru/theater/copy (the source is here http://dl.dropbox.com/u/361607/copy.php)
Here’s my page2, which contains PHP script and a calendar tag: http://vulichenko.ru/inc/mini (the source is here http://dl.dropbox.com/u/361607/mini.php)
Here’s my JS:
$(document).ready(function(){
var month = 04;
var year = 2012;
render_calendar(month,year);
function render_calendar(month,year) {
$.post(
"http://vulichenko.ru/inc/mini",
{ month : month, year : year },
function(str) {
$('#mc_wrap').html(str).fadeIn();
}
);
}
});Here’s my php:
<?php
if (isset($_POST['month'])) :
$month = $_POST['month'];
$year = $_POST['year'];
else :
$month = date('m');
$year = date('Y');
endif;
?>
The result is that the calendar alwasy shows the current month (not the April as in POST request)
The problem is even if I try to just output the POST or GET requests (without any calendar tags), the output is empty (please see the screenshots:
http://dl.dropbox.com/u/361607/Screenshots/28.png
http://dl.dropbox.com/u/361607/Screenshots/27.png
(ARRAY’s are the result of test tags used to test php output:
<?php print_r($_POST);?>
<?php print_r($_REQUEST);?>The PHP in inc/many template is turned on input. But it looks like PHP cannot fetch any requests (POST or GET).
I will highly appreciate any help.
Thank you!