Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 291821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:07:25+00:00 2026-05-12T06:07:25+00:00

Any one know how to go back to the last page after a user

  • 0

Any one know how to go back to the “last page” after a user is presented the login screen and chooses to create a new account?

Basically the sequence is this:

  1. User tries to get to protected content
  2. Redirected to login page
  3. If he logs in he is redirected to original page
  4. If he chooses “create new account” and fills it out, he is redirected to the home page

How do we get him automatically redirected to the original page (not a static page).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T06:07:26+00:00Added an answer on May 12, 2026 at 6:07 am

    There are several ways to go about this. The most straight-forward is to have a login link somewhere in the navigation that appends the destination to the url. The code for this is something like:

    <?php
      if (user_is_anonymous()) {
        $link = l(t('Login'), 'user/login', array('query' => drupal_get_destination()));
      }
    ?>
    

    You can also set a custom access denied page at admin/settings/error-reporting that could either go to a callback that outputs the above code, or to a simple php node that outputs that code.

    Additionally, the user login block provided with Drupal core uses the same method to redirect a successful login back to the originating page.

    Edit: Note that the above methods will rarely work for registration, because there are more steps involved there. Specifically, when a user needs to verify an email address, passing the originating destination along via the email would involve modifying the core user registration process.

    It will potentially still work on a site configured to not verify email addresses. The idea then would be to provide 2 links: 1 for login and the other for registration, both passing along destination information.

    LoginToboggan may also be worth pursuing, although it doesn’t yet offer the exact registration feature you’re looking for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does any one know in which programming language were Google Talk application developed. yes
Does any one know what is the exact usage of xmlns in HTML, XML
Does any one know if there is kinda implementation/addon for VS 2008 SP1 for
Does any one know when Microsoft intends to stop supporting Visual Studio 2002?
Does any one know how to connect my c# console application to .net remoting
Does any one know how I would have to change the following to work
Does any one know about opensource network monitor tool for BlackBerry ?
does any one know of any good countdown timer's for flash which i can
Does any one know how to show the numbers keyboard in the iphone rather
Does anyone know if there's a Flash (ActionScript) library for providing back button support?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.