I have been trying to redirect users after filling out the user registration if referred from a specific page on the site with form_alter like so
function custom_markup_form_alter(&$form, &$form_state, $form_id) {
if($form_id == 'user_register_form' && strpos($_SERVER['HTTP_REFERER'],
'/resources/price-sheets') > 0 ) {
$form_state['redirect'] = 'node/50';
}
}
If I dpm($form_state)
on the user/registration page it shows the $form_state['redirect'] = 'node/50';
as it should. But when I submit the form it redirects me to the home page. I also tried replacing $form_state['redirect'] = 'node/50';
with $_GET['destination'] = 'node/50';
with the same results. I've found a few similar questions, but none of those answers are working for me either, does anyone have a good working solution?