doforumda Posted May 26, 2011 Share Posted May 26, 2011 Hi I am new to codeigniter. I am making a login system. I just finished login form but when i hit login button then it displays this error The requested URL /ci_login/user/login was not found on this server. here is my code so far user.php file which is in controller forlder <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class User extends CI_Controller { function __construct() { parent::__construct(); } function index() { } function login() { if($this->form_validation->run() == FALSE) { $this->load->view('view_login'); } else { echo "Successfull"; } } } view_login.php file which is in view folder <html> <head> <title>Login</title> </head> <body> <h1>Please Login!</h1> <p>Use the login form below to login.</p> <div id="login_form"> <?php echo form_open(base_url(). 'user/login' ) ?> <label>Username:</label> <div> <?php echo form_input(array('id' => 'username', 'name' => 'username')); ?> </div> <label>Password:</label> <div> <?php echo form_password(array('id' => 'password', 'name' => 'password')); ?> </div> <div> <?php echo form_submit(array('name' => 'submit'),'Login'); ?> </div> <?php echo form_close(); ?> </div> </body> </html> help please how can I solve this error? Link to comment https://forums.phpfreaks.com/topic/237535-need-help-in-codeigniter/ Share on other sites More sharing options...
samitrimal Posted May 27, 2011 Share Posted May 27, 2011 This may help you <?php echo form_open(base_url(). 'index.php/user/login' ) ?> Link to comment https://forums.phpfreaks.com/topic/237535-need-help-in-codeigniter/#findComment-1221017 Share on other sites More sharing options...
mikegeorgeff Posted June 3, 2011 Share Posted June 3, 2011 remove the base_url() from your form open because the form_open() function automatically grabs the full site url. Link to comment https://forums.phpfreaks.com/topic/237535-need-help-in-codeigniter/#findComment-1224495 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.