Hi,
I have created a new module, when we enter in this module like 'user/newmodule' in the address bar.
A form is displayed that takes some input and put the values in the database after submission. At the end of the newmodule_form_submit function, I have used drupal_goto('newmodule') and I have put the code in the newmoudle_menu function like this.
function newmodule_form_submit($form_id,$form_values){
......
......
......
......
......
drupal_goto('newmodule');
}
function newmodule_menu($may_cache){
$items[] = array('path' => 'newmodule',
'title' => t('On New Module'),
'callback' => 'newmodule_all',
'access' => user_access('access newmodule content'),
'type' => MENU_CALLBACK);
}
and the function newmodule_all .............
function newmodule_all(){
// content variable that will be returned for display
$page_content = '';
// Get today's date
$today = getdate();
// calculate midnight one week ago
$start_time = mktime(0, 0, 0, $today['mon'], ($today['mday'] - 7), $today['year']);
// we want items that occur only on the day in question,
// so calculate 1 day
$end_time = $start_time + 86400;
// 60 * 60 * 24 = 86400 seconds in a day