• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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 the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#3
if not working altimes else working
Reply

#4
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.