Skipping the Redirect page

Discussion in 'Customization & add-ons' started by stevenjohn, Aug 14, 2010.

  1. stevenjohn

    stevenjohn Member

    Joined:
    Nov 9, 2006
    Messages:
    40
    Hi there,

    I'm suspicious the 'redirecting you' page you see after logging in delays things, and doesnt really provide any useful function - I just want people to login to our site asap, I dont need a 'we're now loading the system for you, please wait...'...

    Anyone know how to get rid if the page that displays via redirect.html so you get a quicker login?

    Thanks, Steve
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Edit common.inc.php and file this function :
    PHP:
    function html_redirect($url$print_header=0$title=''$text=''){
        global 
    $t;
        if (!
    $t$t = &new_smarty();
        
    $t->assign('title'$title);
        
    $t->assign('text'$text);
        
    $t->assign('url'$url);
        
    $t->display('redirect.html');
    }
    change it to:
    PHP:
    function html_redirect($url$print_header=0$title=''$text=''){
        global 
    $t;
        
    header("Location: $url");exit;
    }
  3. stevenjohn

    stevenjohn Member

    Joined:
    Nov 9, 2006
    Messages:
    40
    Thanks

    Thanks Alex, works perfect - appreciate your help
  4. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    @alexander, what is the downside to making this change? I assume the redirect was there for a reason, so what functionality is lost as a result of bypassing it?
  5. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Mostly this was done to avoid page refreshes by user For example if user redirected to a page that takes some time to render he can press F5 thinking that page was not loaded and resend POST data from previous page. And this can create double payments, errors that user will not understand etc...

Share This Page