hook_menu/MENU_CALLBACK access denied I am using hook_menu() to generate a series of MENU_CALLBACKS for processing data at various points in my sites operations. However, while these work for the admin, when trying to access the pages I get the following error message:

You are not authorized to access this page.


I am trying to get this so that the pages can be reached by all users (one is used for submitting a form and processing the results), the other is used for logging outgoing data. The code is as follows:

function modulename_menu() {
  $items = array();
   $items['data/update'] = array(
    'page callback' =&gt; 'dataupdate',
    'access callback' =&gt; TRUE,
    'type' =&gt; MENU_CALLBACK,
  );
   $items['onthewayout/forward'] = array(
    'page callback' =&gt; 'register_click',
    'access callback' =&gt; TRUE,
    'type' =&gt; MENU_CALLBACK,
  );
  return $items;
}
I tested out the hook_menu in my local. The hook seems fine. Check if you have added an  access denied code in the callback function


function commons_menu() {
  $items = array();
   $items['data/update'] = array(
    'page callback' => 'dataupdate',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );
   $items['onthewayout/forward'] = array(
    'page callback' => 'register_click',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );
  return $items;
}

function dataupdate() {
  return drupal_set_message("First one is working");
}

function register_click() {
  return drupal_set_message("Second one is also working");
}




This returns a Access Denied to me even if access callback is true.


function register_click() {
  drupal_access_denied();
  exit;
}