Yohanne Posted September 25, 2014 Share Posted September 25, 2014 Hi, any body can help, i got 404 message and i dont know the exact way on how to resolve it. i have url login page like this : http://localhost/prok/run32.php and now if the user get correct username and password, page will load or redirect in this but in this link i get 404 message http://localhost/prok/index.php/dashboard/catalog please take a look my way of coding. #routes.php $route['default_controller'] = 'Login'; $route['404_override'] = ''; $route['dashboard/(:any)'] = 'dashboard/Catalog'; #controllers/login.php <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Login extends CI_Controller { function __construct() { parent::__construct(); $this->load->helper('url'); } public function index() { $this->load->view('login'); $array = array(); if(isset($_POST['submit'])) { $username = $this->security->xss_clean($this->input->post('username')); $password = $this->security->xss_clean($this->input->post('password')); if(empty($username)) { $array[] = "<p>Please fill-in required field!</p>"; } else { $username = mysql_real_escape_string($username); } if(empty($password)) { $array[] = "<p>Please fill-in required field!</p>"; } else { $password = mysql_real_escape_string($password); } if(sizeof($array) > 0) { foreach($array as $val); { echo "<p>$val</p>"; } } else { $this->load->model('login_process'); $result = $this->login_process->validated(); if(!$result) { echo "<p> Invalid usernamessssss and password.</p><br />"; } else { #$this->load->view('dashboard/catalog','refresh'); redirect('dashboard/catalog','refresh'); } } } } } #controllers/dashboard/catalog.php <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Catalog extends CI_Controller { public function index() { $this->load->view('dashboard/catalog'); } } please advise, what im doing wrong. Thanks advance Quote Link to comment https://forums.phpfreaks.com/topic/291272-404-page-not-found-in-codeigniter/ Share on other sites More sharing options...
sKunKbad Posted September 27, 2014 Share Posted September 27, 2014 You've got index.php in your URL. What happens if you remove it? Quote Link to comment https://forums.phpfreaks.com/topic/291272-404-page-not-found-in-codeigniter/#findComment-1492241 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.