Broseph
02-03-2013, 11:22 PM
I'm trying to implement some ajax functionality and I'm having trouble with getting the required information in the back end. Here is the clientside code:
YAHOO.util.Connect.asyncRequest(
'POST',
'ajaxtest.php', {
success: function(data) {
console.log(data);
}
},
SESSIONURL + 'securitytoken=' + SECURITYTOKEN
);
And here is ajaxtest.php:
<?php
define('THIS_SCRIPT', 'ajaxtest');
define('CSRF_PROTECTION', true);
require_once('./global.php');
global $userinfo, $foruminfo;
print_r($userinfo);
print_r($foruminfo);
Looking at threadrate.php it seemed like that should be all I needed to do to get access to globals such as $foruminfo and $userinfo. The request is fired from a script that is loaded in the head of forumdisplay.php and I all I get is an empty array back.
Am I missing something?
YAHOO.util.Connect.asyncRequest(
'POST',
'ajaxtest.php', {
success: function(data) {
console.log(data);
}
},
SESSIONURL + 'securitytoken=' + SECURITYTOKEN
);
And here is ajaxtest.php:
<?php
define('THIS_SCRIPT', 'ajaxtest');
define('CSRF_PROTECTION', true);
require_once('./global.php');
global $userinfo, $foruminfo;
print_r($userinfo);
print_r($foruminfo);
Looking at threadrate.php it seemed like that should be all I needed to do to get access to globals such as $foruminfo and $userinfo. The request is fired from a script that is loaded in the head of forumdisplay.php and I all I get is an empty array back.
Am I missing something?