PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, March 16, 2022

[FIXED] Codeigniter shows 404 no page found.

 March 16, 2022     codeigniter, lamp, php     No comments   

Issue

Well I have a strange problem in my Codeigniter page. I have a controller class books.php

> <?php
> //echo 'Hello';
> class Books extends CI_Controller{
>     function __construct() {
>         parent::__construct();
>     }
>     
>     
>     function main()
>     {
>         $this->load->view('main_view');
>     }
>     
>     function input()
>     {
>         $this->load->view('input_view');
>     } } ?>

Now if I point my browser to http://localhost/CodeIgniter/index.php/books it shows 404 Page not found. Now If I add a echo 'Hello'; just above the class declaration, it shows hello and at the top of the page and after that line the same 404 error.Is this due to permission roblem. books.php have 777 permission.


Solution

> <?php
> //echo 'Hello';
> class Books extends CI_Controller{
>     function __construct() {
>         parent::__construct();
>     }
>     
>     
>     function index()
>     {
>         $this->load->view('main_view');
>     }
>     
>     function input()
>     {
>         $this->load->view('input_view');
>     } } ?>


Answered By - danish hashmi
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing