Created
June 12, 2013 20:24
-
-
Save postrational/5768796 to your computer and use it in GitHub Desktop.
Drupal 7 - Redirect your users to a custom page after sending a message using site wide contact forms
Place the following code in the template.php file of you theme.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_theme_form_alter(&$form, &$form_state, $form_id) { | |
if ($form_id == 'contact_site_form') { | |
$form['#submit'][] = 'contact_form_submit_handler'; | |
} | |
} | |
function contact_form_submit_handler(&$form, &$form_state) { | |
$form_state['redirect'] = 'thank-you-page-alias'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. Could I ask a question about this?