Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8100865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:51:07+00:00 2026-06-05T22:51:07+00:00

I am trying to learn codeigniter and for some reason I can’t do the

  • 0

I am trying to learn codeigniter and for some reason I can’t do the simplest of things.

Basically I am creating a form on a login page. But I am getting

Fatal error: Call to undefined function validation_errors() in A:\work\codeigniter\ci\application\views\pages\login.php on line 5

and if I comment out the validation_errors line, I get

Fatal error: Call to undefined function form_open() in A:\work\codeigniter\ci\application\views\pages\login.php on line 5
…

Error message

( ! ) Fatal error: Call to undefined function validation_errors() in A:\work\codeigniter\ci\application\views\pages\login.php on line 3
Call Stack
#   Time    Memory  Function    Location
1   0.0004  697328  {main}( )   ..\index.php:0
2   0.0010  790176  require_once( 'A:\work\codeigniter\ci\system\core\CodeIgniter.php' )    ..\index.php:202
3   0.0135  2313080 call_user_func_array ( )    ..\CodeIgniter.php:359
4   0.0135  2313160 Pages->view( )  ..\CodeIgniter.php:359
5   0.0135  2313288 CI_Loader->view( )  ..\pages.php:9
6   0.0135  2314232 CI_Loader->_ci_load( )  ..\Loader.php:419
7   0.0138  2363392 include( 'A:\work\codeigniter\ci\application\views\pages\login.php' )   ..\Loader.php:833

This is my code:

login.php located at view\pages

<?php echo validation_errors(); ?>

<?php echo form_open('user/login') ?>

    <label for="Id"> User Id</label>
    <input type="input" name="Id" /> <br/>
    
    <label for="Password">User Password</label>
    <input type="input" name="Password" />
    <br/>
    
    <input type="submit" name="submit" value="log in" />
    
</form>

user.php located at controllers\

<?php
    class User extends CI_controller{
    public function login()
    {
        $this->load->helper('form');
        $this->load->library('form_validation');
        
        //i have a file views/pages/main.php which just says "this is main"
        $this->load->view('pages/main'); 
    }
    }

pages.php located at controllers/

<?php

    class Pages extends CI_Controller{
    public function view($page){
        if(!isset($page)||!file_exists("application/views/pages/$page.php")){
        show_404();
        }
        
        $this->load->view("pages/$page");
        
        
    }
    }

routes.php located at config/

$route['default_controller'] = "pages/view";
$route['(:any)']="pages/view/$1";
$route['404_override'] = '';

this is what I think happens and if I am wrong, please correct me.
form_open(‘user/login’) makes the "action" of the html form element point to a method "login" of class "user" located in controlers.

also, I googled a lot and pretty much everyone else that was getting this error was getting it because they hadnt done

$this->load->helper('form');
$this->load->library('form_validation');

Also, I don’t get the string in form_open points to the location for the "action" attribute in the html form element. Why is it neccessary to load form helper and form validation library there? Can someone explain the flow of this, please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:51:08+00:00Added an answer on June 5, 2026 at 10:51 pm

    basically the problem was that the controller that was calling the view with the form should contain

    $this->load->helper('form');
    $this->load->library('form_validation');
    

    and not the controller that is being called by the form action

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying to learn codeigniter (following a book) but don't understand why the web
I am trying to learn CodeIgniter to use for a shopping site, but I
I'm a total newbie with socks5, but I'm trying learn by creating a socks5
Im trying to learn OOP but I need to see some real case scenarios
Im trying to learn a bit about c++ and have run in to some
I'm an amateur, admittedly so, but I'm having fun trying to learn a little
Trying to learn PL/SQL with multimedia data. Can anyone please point out that from
Trying to learn F# but got confused when trying to distinguish between fold and
Trying to learn some R after doing mostly Haskell for rather a long time
Trying to learn some F# and I've run into a couple of hangups. Here's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.