Welcome Guest, Not a member yet? Register   Sign In
Redirect Function with custom delay
#1

[eluser]Yash[/eluser]
I've added a fourth parameter.If you want to redirect on other url after sometime just use this parameter.You can pass any time delay value.
Not BIG deal in this but can cause problem sometime.
Code:
<?php

if ( ! function_exists('redirect'))
{
    function redirect($uri = '', $method = 'location', $http_response_code = 302,$time=0)
    {
        switch($method)
        {
            case 'refresh'    : header("Refresh:$time;url=".site_url($uri));
                break;
            default            : header("Location: ".site_url($uri), TRUE, $http_response_code);
                break;
        }
        exit;
    }
}

?>

Replace this function with your system/helper/url_helper.php function.


Messages In This Thread
Redirect Function with custom delay - by El Forum - 07-26-2008, 11:34 AM
Redirect Function with custom delay - by El Forum - 07-26-2008, 08:57 PM
Redirect Function with custom delay - by El Forum - 07-26-2008, 09:07 PM
Redirect Function with custom delay - by El Forum - 07-26-2008, 10:01 PM
Redirect Function with custom delay - by El Forum - 07-26-2008, 10:21 PM
Redirect Function with custom delay - by El Forum - 07-27-2008, 04:17 AM



Theme © iAndrew 2016 - Forum software by © MyBB