doforumda Posted May 26, 2011 Share Posted May 26, 2011 I am making login system using codeigniter. When I run my code i get 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 folder <?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? Quote Link to comment https://forums.phpfreaks.com/topic/237545-need-help-with-php-url-not-found/ Share on other sites More sharing options...
co.ador Posted May 26, 2011 Share Posted May 26, 2011 is it view_login.php You need to address that int he load part in the php class instead of $this->load->view('view_login'); put $this->load->view('view_login.php'); lol Quote Link to comment https://forums.phpfreaks.com/topic/237545-need-help-with-php-url-not-found/#findComment-1220669 Share on other sites More sharing options...
doforumda Posted May 26, 2011 Author Share Posted May 26, 2011 This is not the problem. I did this way but it still displaying this error. any other solution please... Quote Link to comment https://forums.phpfreaks.com/topic/237545-need-help-with-php-url-not-found/#findComment-1220678 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.