Dynamic parameters passed to page callback I have the following hook_menu:

  $items['products/autocomplete.json/%'] = array(
    'page callback' =&gt; 'json_list_products',
    'access arguments' =&gt; array('access products')
  );


Here is the function:

function json_list_products($keywords) {

  $items = array();
  foreach(_sql_select_products($keywords) as $product) {
    $items[$product['Product_ID']] = $product['Product_Name'];
  }    

  drupal_json_output($items);
}


$keywords is not populated with the value of the % as i suspected - how do I populate this value? 

Alex
$items['products/autocomplete.json/%'] = array(
    'page callback' =&gt; 'json_list_products',
    'access arguments' =&gt; array('access products'),
    'page arguments' =&gt; array(2),
  );


view the documentation at this link