Welcome Guest, Not a member yet? Register   Sign In
The requested URL was not found on this server
#1

[eluser]Unknown[/eluser]
This issue is driving me mad. For 2 days I have been trying to do a simple login system but I keep getting the above error.

Code:
<form method="post" action="<?php echo base_url()?>user_controller/login" accept-charset="UTF-8">

when submitting the form I get the following error: The requested URL /wishlist/user_controller/login was not found on this server.

Here are some settings from Codeigniter:

Code:
$config['base_url'] = '';
$config['index_page'] = 'index.php';
$autoload['helper'] = array('url');
$route['default_controller'] = "user_controller";

.htaccess
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

Here is the user_controller:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class User_controller extends CI_Controller {


function index() {

  $this->load->view('main_view');
}



function login() {

  $data['error'] = 0;
  if ($_POST) {
   $this->load->model('user_model');
   $username = $this->input->post('username', true);
   $password = $this->input->post('password', true);

   $user = $this->user_model->login($username, $password);

   if (!$user) {
    $data['error'] = 1;

   } else {
    $this->session->set_userdata('userID', $user['userID']);
    $this->session->set_userdata('username', $user['username']);
    redirect(base_url().'admin_controller');
   }
  }

  $this->index();
}



function logout() {

  $this->session->sess_destroy();
  $this->index();
}


}

I also asked the qustion on Stack Overflow, but none of the answers gave me a solution. Thread can be found here

Please let me know if you need any additional information.
#2

[eluser]Aken[/eluser]
Is the error page generated by CodeIgniter or your server? That may help narrow down the problem.
#3

[eluser]Unknown[/eluser]
[quote author="Aken" date="1353901635"]Is the error page generated by CodeIgniter or your server? That may help narrow down the problem.[/quote]

seems that its generated by my localhost/wamp server since there is no styling
#4

[eluser]Unknown[/eluser]
A difficult problem solved Smile





Theme © iAndrew 2016 - Forum software by © MyBB