Using drupal_get_destination() in a link item "l()"


/ Published in: PHP
Save to your folder(s)

When adding a link to a form say for instance a login form you can use drupal_get_destination() to return the user to the page they were on when they finish loging in. This show you how to do this programatically in a link l(); function.


Copy this code and paste it in your HTML
  1. global $base_url;
  2. l("Member Login", $base_url."/user/login?".drupal_get_destination()),);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.