I´ve got a Drupal site that after the user logs in it is redirected to his profile. I want to create a specific rule so people from specific characteristics can retur to the page they were before they´ve logged in.
I´m planning to do that with the rules module.
So, I´ve set the parameters and conditions, but when I try to create the rule, telling Drupal where it should redirect people, I just don´t know how to say that.
I think I should put some php code inside that page redirect rule, but don´t know how. Hopw you can help me out.
FYI, I've tried (unsuccessfully) this:
$_SESSION['redirect_to'] = $_SERVER['REQUEST_URI']; header("Location: http://www.mysite.net/user"); exit(); // On successful login $redirect = $_SESSION['redirect_to']; // unset the session var unset($_SESSION['redirect_to']); header("Location: http://www.mysite.net/$redirect"); exit();