Jump to content

404 page not found in codeigniter


Yohanne

Recommended Posts

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

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.