By dsnoeck on
Hello developers,
What is the best approach to do a SQL query when a user click on a link and then redirect him to a page (in my module, to the add comment page) ?
I have thinking to use the page callback into the hook_menu like this:
$items['path/accept/%'] = array(
'page callback' => 'accept_absence',
'page arguments' => array(2),
'type' => MENU_CALLBACK)
and then a function accept_absence() which contain the INSERT query and the redirection.
I can do the SQL stuff, but not the redirection.
Is it a good approach ? And how to to a redirection ?
Thanks for you help.
-Damien
--------------------
Keep OpenSpirit
Comments
drupal_goto
drupal_goto
http://api.drupal.org/api/function/drupal_goto
http://www.trailheadinteractive.com