Hello,
I made a block which is an form with 2 fields. When i submit this block form, i expect to list the results of the query in a paged table. But it fails on the second pasge, because the url variable is an array. How to solve that with Drupal ? Help is very much welcome. Thank's in adavnce .
Here is an simplification of my code.
function af_block($op='search', $delta=0) {
$form = form_textfield(t('City'), 'city, '', 15, 100);
$form .= form_textfield(t('PostCode'), 'cp', '', 5, 5);
$form .= form_submit(t('Search'));
$content .= form($form, 'post', url('af/search'));
$block["content"] = $content;
return $block;
}
function af_menu($may_cache) {
$items = array();
$items[] = array('path' => 'af/search',
'title' => t('Recherche Fleuristes'),
'access' => 'access content',
'callback' => 'af_list',
'type' => MENU_CALLBACK);
return $items;
}
function af_list() {
$edit = $_POST['edit']; // $edit is = NULL in the second page
$header = array(array('data' => t('Name'), 'field' => 'organization_name'),
array('data' => t('Adress'), 'field' => 'street_address'),
array('data' => t('City'), 'field' => 'city'));
$params = array("postal_code" => $edit['cp']);
// Simplification with only on query