I have a PHP script used for AJAX queries, but I want them to be able to operate under the umbrella of Joomla\'s (2.5) framework so I can have session id\'s, user id\'s etc
You don't need to create any custom files and add them into Joomla script. You just need a controller to serve ajax request. You don't even need a view (one way).
Your ajax call should be like these:
$(function () {
$.ajax({
url: 'index.php?option=com_&no_html=1task=.', //not_html = 1 is important since joomla always renders it's default layout with menus and everything else, but we want the raw json output
dataType: 'json' //data format
...
});
});
And your controller:
/*
* @file admin/controller/.php
*/
class Controller extends JController
{
public function ()
{
//do something
$respnse['message'] = 'Your message for the view';
die(json_encode($reponse));
}
}
...
This is just one of the examples of how it's could be done.