I got a Form and a Table displayed on the same page. The weird thing is that when the form is submitted and the page are reloaded (after doing a database SELECT) with $_POST values, the table is not showing....why?
Here is the code (suppose $tabb2 have correct table data):
<?php
function collabinc_menu($may_cache) {
$items = array();
$items['admin/reporting/report_details2'] = array(
'title' => 'Report: User details by stores',
'access arguments' => array('access content'),
'page callback' => 'say_report_details2',
'type' => MENU_CALLBACK,
);
return $items;
}
function say_report_details2($values = array()) {
$output = "";
if (isset ($_POST['search'])) {
$output = theme("table", $tabb2);
}
$build['content'] = array(
'this_does_not_matter_too_much2' => drupal_get_form("report_details_form"),
'this_does_not_matter_too_much1' => array('#markup' => $output,),);
return $build;
}
Please note that both Form and Table are working, and displayed correctly at the same time when not putting the "if (isset ($_POST['search']))" condition. Also note that the condition is fully working and checked.
Thanks!