Create a script page for handling ajax I am a bit confused on the appropriate way to generate a drupal page for handling ajax posts. For example I'm creating a custom module that has favorites buttons. When a user clicks the button the ajax request sends the data to example.com/ajaxscripts/process.php. I need to create a page at process.php to handle the request but it shouldn't generate the full drupal theme. Rather it should just have access to the core drupal information such as $user and drupal database functionality. How can I create such a page? It seems that tying to use hook_menu() would force a full page rendering.
In your hook_menu, create a menu item with 'type' =&gt; MENU_CALLBACK, like so:

$items['YOUR_MENU_PATH'] = array(
  'page callback' =&gt; 'YOUR_PAGE_CALLBACK',
  ...
  'type' =&gt; MENU_CALLBACK,
);


Then, in your page callback function, you can use the drupal_json_output($some_array) function to convert $some_array to json, and return it, all in one go.

I wouldn't use the .php extension in the menu path.