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 comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.