CodeIgniter Forums
Internal Server Error when doing a redirect from login controller - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Internal Server Error when doing a redirect from login controller (/showthread.php?tid=47011)



Internal Server Error when doing a redirect from login controller - El Forum - 11-23-2011

[eluser]Unknown[/eluser]
I have a fairly simple controller that does a redirect but the problem is I am getting Internal Server Error instead of redirecting to the desired page. Can someone please help. Below is my controller code

I have also tried changing to absolute URL but no luck

redirect('http://localhost:8080/sites/pos/index.php/salesorder');

<?php
class Login extends CI_Controller {


public function Authenticate()
{
$config['hostname'] = "localhost";
$config['username'] = "root";
$config['password'] = "admin";
$config['database'] = "pos";
$config['dbdriver'] = "mysql";
$config['dbprefix'] = "";
$config['pconnect'] = FALSE;
$config['db_debug'] = TRUE;

if ($this->input->post("UserID"))
$userID = $this->input->post("UserID");
if ($this->input->post("Password"))
$password = $this->input->post("Password");

$this->load->model('UserModel','',$config);
$result = $this->UserModel->AuthenticateUser($userID,$password);

if (count($result) == 1)
{
redirect('index.php/salesorder');
}
else
{
echo "failure";
}
}
}
?>