Php Can';我无法访问该页面

Php Can';我无法访问该页面,php,html,codeigniter,Php,Html,Codeigniter,我是新来的协同信号员。当我浏览时,它会显示一个类似“404页面未找到”的错误。下面是代码 控制器代码: Insert.php <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Insertion extends CI_Controller { public function Insert() { $this->load->view('Ins

我是新来的协同信号员。当我浏览时,它会显示一个类似“404页面未找到”的错误。下面是代码

控制器代码: Insert.php

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

class Insertion extends CI_Controller {


    public function Insert()
    {
        $this->load->view('Insert_view');
    }
}
?>
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Welcome to CodeIgniter</title>

</head>
<body>

<div id="container">
    <h1>Hello world!</h1>
</div>

</body>
</html>
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Welcome to CodeIgniter</title>
</head>
<body>
<div id="container">
    <h1>Hello world!</h1>
</div>
</body>
</html>
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Welcome extends CI_Model{
public function Insert()
    {
        $this->load->view('Insertion_view');
    }

视图代码:Insert_View.php

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

class Insertion extends CI_Controller {


    public function Insert()
    {
        $this->load->view('Insert_view');
    }
}
?>
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Welcome to CodeIgniter</title>

</head>
<body>

<div id="container">
    <h1>Hello world!</h1>
</div>

</body>
</html>
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Welcome to CodeIgniter</title>
</head>
<body>
<div id="container">
    <h1>Hello world!</h1>
</div>
</body>
</html>
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Welcome extends CI_Model{
public function Insert()
    {
        $this->load->view('Insertion_view');
    }

欢迎来到CodeIgniter
你好,世界!

如果您的url类似于www.mywebsite.com/insertion,那么控制器文件应该是insertion.php,并带有类insertion

如果你想使用www.mywebsite.com/insert,那么你的控制器文件应该是insert.php和类insert,并将insert函数改为index

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

 class Insertion extends CI_Controller {

   public function index(){
     $this->load->view('insert_view');   
   }

 }

?>

如果您的url类似于www.mywebsite.com/insertion,那么控制器文件应该是insertion.php,并带有类insertion

如果你想使用www.mywebsite.com/insert,那么你的控制器文件应该是insert.php和类insert,并将insert函数改为index

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

 class Insertion extends CI_Controller {

   public function index(){
     $this->load->view('insert_view');   
   }

 }

?>

First视图名为(Insertion\u View.php)的文件代码


欢迎来到CodeIgniter
你好,世界!
然后是名为(Welcome.php)的控制器文件


First视图名为(Insertion\u View.php)的文件代码


欢迎来到CodeIgniter
你好,世界!
然后是名为(Welcome.php)的控制器文件


将控制器文件名改为
Insert.php
而不是
Insert.php
键入什么URL?将控制器文件名改为
Insert.php
而不是
Insert.php
键入什么URL?