Why Drupal 7 cannot redirect properly (I've logged in)?
When I'm trying to call drupal_get_form('user_login') from my module in hook_preprocess_page(), the browser throw that message.
Thank you!
Why Drupal 7 cannot redirect properly (I've logged in)?
When I'm trying to call drupal_get_form('user_login') from my module in hook_preprocess_page(), the browser throw that message.
Thank you!
Drupa_get_form() function is not for redirecting. It is for getting a form. In your case, you are calling the login form. To redirect, use the drupal_goto() function here is a link on the drupal api http://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_goto/7
Well, drupal_get_form('user_login')
causes the issue. So instead of drupal_get_form('user_login')
use drupal_get_form('user_login_block')
and it will work.