CodeIgniter Forums
Problem with redirect - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter Archived (from EllisLab) (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Problem with redirect (/thread-56627.html)



Problem with redirect - El Forum - 01-07-2013

[eluser]Unknown[/eluser]
Hello, im doing a login and when i validate the user data show a white screen, im using redirect to call (menu/user_form) menu class and user_form function.

this is the code of my login controller:

Code:
public function validate_data()
{
$query = $this->login_model->validate();
if($query) //credenciales validadas
{
$data = array( 'username' => $this->input->post('username'), 'is_logedin' => true );
$this->session->set_userdata($data);
redirect('menu/index', 'refresh');
}
else
{
$this->load->view('sieapp/forgot_pass');
}
}

and this is for menu controller:

Code:
class Menu extends CI_Controller
{
public function index()
{
$data['title'] = 'menu';
$this->load->view('sieapp/menu_form', $data);
}
}

Thanks for the help.


Problem with redirect - El Forum - 01-07-2013

[eluser]jprateragg[/eluser]
What exactly is the problem? Are you getting an error on your page? Is it not redirecting? Is there anything on the PHP log? We need some more details before we can help you.


Problem with redirect - El Forum - 01-08-2013

[eluser]Unknown[/eluser]
This is the error that shows the console in chrome:
"Not allowed to load local resource: file:///C:/xampp/htdocs/CodeIgniter/index.php/menu"

In my login controller i made a redirection to the menu class when the user data are validated, but shows me a white screen and the error above, how can i check the PHP log or enable?


Problem with redirect - El Forum - 01-08-2013

[eluser]jprateragg[/eluser]
Open your php.ini file and locate the parameter "error_log". Notice the location, go back to your problematic controller/method, rerun it, then go check the PHP log. It will list errors. Also make sure the following are set in your php.ini:

display_errors = On
error_reporting = E_ALL