Callback function on block In order to create a search block with autocomplete, I'm trying to use a callback function.
But it doesn't work with my module.
This module is implemented on my homepage which is http://mywebsite.com/lastnews

Could you help me?

Here is my code :

//my module
function search_city_block_info() {
  $blocks['search_city'] = array(
    'info' =&gt; t('Search a city'),
    'cache' =&gt; DRUPAL_NO_CACHE,
  );
  return $blocks;
}

//my block
function search_city_block_view($delta = ''){
    switch ($delta) {
        case 'search_city':
            $block['subject'] = t('Search a city');
            $block['content'] = drupal_get_form('search_city_form');
            break;
    }
    return $block;
}

//just for the callback for autocomplete
function search_city_menu() {
  $items['search_city_page_autocomplete'] = array(
    'page callback' =&gt; 'search_city_autocomplete',
    'access arguments' =&gt; array('access content'),
    'type' =&gt; MENU_CALLBACK,
  );
  return $items;
}

//the form with the search field
function search_city_form($form, &amp;$form_state) {
  $form = array();
  $form['City'] = array(
    '#title' =&gt; t('City'),
    '#type' =&gt; 'textfield',
    '#maxlength' =&gt; 60,
    '#autocomplete_path' =&gt; 'search_city_page_autocomplete',
  );
  $form['submit'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; 'Submit',
  );
  return $form;
}

//the values for autcomplete
function search_city_autocomplete($text) {
  $results = array();
  $results['city1'] = 'thefirstcity';
  $results['city2'] = 'thesecondcity';
  drupal_json_output($results);
}
Try this
//the values for autcomplete

function search_city_autocomplete($text = NULL) {
$results = array();
  $results['city1'] = 'thefirstcity';
  $results['city2'] = 'thesecondcity';
  print drupal_json_encode($results);
exit();
}