0

on my http://localhost/qconsolidated/login_controller/login this error appears:

Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

I always get this error everytime i click the submit button on my form. I have checked my it back and forth for 2 days now, and still could't get it right. please help me. Here are the codes that I made:

login_controller.php

defined('BASEPATH') OR exit('No direct script access allowed');

class Login_controller extends CI_Controller {

    public function index(){
        $this->load->view('template/header');
        $this->load->view('login_view');
        $this->load->view('template/footer');
    }

    public function login(){
            echo "<script> alert('Working!'); </script>";   
    }

login_view.php

<div class="container">
    <form class="form-login" method="post" action="/login_controller/login">

        <img src="<?php echo base_url(); ?>public/img/q_logo.png">

        <label class="sr-only">Email address</label>
        <input type="email" name="email" class="form-control" placeholder="Email address" required autofocus>
        <label class="sr-only">Password</label>
        <input type="password" name="password" class="form-control" placeholder="Password" required>

        <button class="btn btn-lg btn-primary btn-block" type="submit">Log in</button>

    </form>
</div>

Please help me

3 Answers 3

2

change your action url.

<form class="form-login" method="post" action="<?php echo base_url()?>/login_controller/login">
Sign up to request clarification or add additional context in comments.

Comments

0

change form action.Use something like this

<form class="form-login" method="post" action="<?php echo site_url('login_controller/login');?>">

you can also achieve this by using form_open('login_controller/login');

Comments

0

Try like this used base_url

<form class="form-login" method="post" action="<?php echo base_url("login_controller/login");">

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.