Welcome Guest, Not a member yet? Register   Sign In
how to redirect back url
#1

I using user agent to redirect back url but it workes in single CI, but I'm using multiple site 

if currently i'm using test.domain.com and my session is login and i'm directly used in the url login page like accounts.domain.com then how to redirect back subdomain or back page
Reply
#2

You can try this:

PHP Code:
/**
 * Method to redirect to the previous page
 *
 * Add to one of your helpers
 *
 * USEAGE: redirectPreviousPage();
 */
if ( ! function_exists('redirectPreviousPage'))
{
 
   function redirectPreviousPage()
 
   {
 
       if (isset($_SERVER['HTTP_REFERER']))
 
       {
 
           header('Location: '.$_SERVER['HTTP_REFERER']);
 
       }
 
       else
        
{
 
           header('Location: http://'.$_SERVER['SERVER_NAME']);
 
       }
 
       
        exit
;
 
   }
}

redirectPreviousPage(); 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

if not working altimes else working
Reply
#4

(This post was last modified: 10-19-2016, 04:43 AM by demonicinn.)

if not working all times else working

yes its working I'm using browser events to redirect back page.

from 1 subdomain to another subdomain
Reply
#5

You can add back url to memcache/redis or session
Reply




Theme © iAndrew 2016 - Forum software by © MyBB