redirects ()
URL Helper
The redirect operator in the code igniter sends the user to the specified web page using the redirect header instruction.
This statement is in the URL helper, which loads as follows:
$this->load->helper('url');
The redirection function loads the local URI specified in the first parameter of the function call and is created using the options specified in your configuration file.
The second parameter allows the developer to use different HTTP commands to perform a "location" or "refresh" redirect.
According to Code Igniter documentation: "Location is faster, but on Windows servers this can sometimes be a problem."
Example:
if ($user_logged_in === FALSE) { redirect('/account/login', 'refresh'); }
Jon Winstanley Apr 7 '09 at 11:27 2009-04-07 11:27
source share