Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Codeigniter 未找到CI 3请求的url_Codeigniter_Codeigniter 3 - Fatal编程技术网

Codeigniter 未找到CI 3请求的url

Codeigniter 未找到CI 3请求的url,codeigniter,codeigniter-3,Codeigniter,Codeigniter 3,我是CI 3的新手。单击按钮时,我想查看另一页。我正在使用Wamp服务器。在我的根文件夹(www)中,我将我的项目命名为sampleproject 在myroutes.php中 $route['default_controller'] = 'user'; 控制器文件名称为User.php public function login_user(){ $this-load-view('welcome_message'); } 在我看来 <form action="/user/log

我是CI 3的新手。单击按钮时,我想查看另一页。我正在使用Wamp服务器。在我的根文件夹(www)中,我将我的项目命名为sampleproject

在my
routes.php中

$route['default_controller'] = 'user';
控制器文件名称为User.php

public function login_user(){
    $this-load-view('welcome_message');
}
在我看来

<form action="/user/login_user" method="POST" role="form">
    <button class="btn btn-primary btn-block">Login</button>
</form>

登录
当我单击URL中的按钮时,它会显示

->显示索引,但输入时->表示未找到请求的URL


为什么我不能查看其他页面?

APPPATH.config/config.php'
中,您应该设置

$config['base_url'] = 'http://localhost/sampleproject/'
最后,在
.htaccess
文件中:

RewriteBase /sampleproject/

APPPATH.config/config.php'
中,您应该设置

$config['base_url'] = 'http://localhost/sampleproject/'
最后,在
.htaccess
文件中:

RewriteBase /sampleproject/

您是否将
.htaccess
设置为删除
index.php
。?项目名称为
sample
sampleproject
?请尝试此
http://localhost/sampleproject/index.php/user/login_user
是否将
.htaccess
设置为删除
index.php
。?项目名称为
sample
sampleproject
?试试这个
http://localhost/sampleproject/index.php/user/login_user