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

  • Home
  • SEARCH
  • 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 7194363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:21:22+00:00 2026-05-28T20:21:22+00:00

I have a certain class which receives request from different views. It handles the

  • 0

I have a certain class which receives request from different views. It handles the request and should redirect the user to the view that they were “visiting”. Is there any way I can identify this view so i can load it back to the browser?

Thank you.

  • 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-28T20:21:23+00:00Added an answer on May 28, 2026 at 8:21 pm

    Why not just redirect back the referring page? Here are some functions I usually put in a MY_url_helper.php file to accomplish this:

    <?php
    function redirect_back()
    {
        redirect($_SERVER['HTTP_REFERER']);
    }
    
    function save_next($next_url = NULL)
    {
        if (empty($next_url))
        {
            $next_url = current_url();
        }
    
        $CI =& get_instance();
        $CI->session->set_userdata('next_url', $next_url);
    }
    
    function redirect_next($fallback = '')
    {
        $CI =& get_instance();
        $next = $CI->session->userdata('next_url');
        if ( !empty($next))
        {
            $CI->session->unset_userdata('next_url');
            redirect($next);
        }
    
        redirect($fallback);
    }
    

    Couple ways to use these functions:

    1. Call redirect_back() in the controller action that processes, say, form data
    2. Call save_next() in the controller action that displays the view, then call redirect_next() in the controller action that processes the form data

    It’s not all too RESTlike, but it gets the job done, freeing you to focus on the more important things in life…

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

Sidebar

Related Questions

I have a class which for now should always have a certain member populated
I have certain PHP class methods that access external variables. These variables are not
I have a class that only really ever needed by classes in a certain
I have a User class which has a List field namely pt. This field
i have a class which, when a certain part of the gui is clicked
I have a Utils class which shows UIAlertView when certain notifications are triggered. Is
In my app, I have many different functions. These are view controllers that are
I have two threads running from a controller class. The first thread receives SMS
I'm still not very much used to Java. I have a class which should
I have a controller class which spawns a window when a certain condition occurs.

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.