Welcome Guest, Not a member yet? Register   Sign In
How does redirect (in the url helper) work?
#1

[eluser]Unknown[/eluser]
Hi,

I would like to talk about how the redirect() method in the CI core/helpers/url_helper.php file works. After having read the method's source code (lines 521-552 in that file), I still have these questions:

Here is a snippet of made-up code for reference.

Code:
<?php
//...inside a controller that extends CI_Controller...

if ( $condition == TRUE ) {
   redirect( 'controller1/method1' );
}

load->view->( 'controller1/method2' );

?>

Is there a way for the client to prevent redirection? (ex. via some browser settings)
If so, what happens if the client prevents redirection? (ex. can it be detected server-side?) I have no experience with the intricacies of HTTP header manipulation.

If execution of the above code reaches the redirect() call, does CI ever execute anything beyond the redirect() call? (I see the redirect() method ends with exit(), but want to make sure I'm not missing something)

Eric




Theme © iAndrew 2016 - Forum software by © MyBB