PHP   发布时间:2022-04-04  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了php-找不到404页面未找到您请求的页面.代码点火器大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

我已经在代码点火器上开发了一个Web应用程序..这是我第一次在代码点火器上工作..在本地主机上开发了Web应用程序之后,所以我决定将我的代码点火器Web应用程序放置在临时免费服务器上..所以我在这个网站上上传了我的网站
1freehosting …,然后我导入了数据库..之后,我更改了database.PHP文件..中数据库的设置,并且还更改了config.PHP文件..中的基本url,因为这是我的域名http://hello.hostingsiteforfree.com/. ..所以我将其更改为该URL ..但随后出现以下错误…我不知道出了什么问题..我进行了很多搜索,但无济于事..而且我忘了提到我的.htaccess文件为空..意味着其中没有一行

这是我得到的错误

404 Page Not Found

The page you requested was not found.

routes.PHP

    <?PHP  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

 $route['default_controller'] = "loginController";
$route['404_override'] = '';


 /* Location: ./application/config/routes.PHP */

我的控制器

   <?PHP if ( ! defined('BASEPATH')) exit('No direct script access allowed');

LoginController类扩展了CI_Controller {

 function index(){

    $new['main_content'] = 'loginView';
    $this->load->view('loginTemplate/template', $new); 

}




function verifyUser(){

    //getting parameters from view 
    $data = array(
            'username' => $this->input->post('username'),
            'password' => $this->input->post('password')
    );


    $this->load->model('loginModel'); 
    $query = $this->loginModel->validate($data);


          if ($query){             //if the user c validated
        //data variable is created becx we want to put username in session
            $data = array(
                'username' => $this->input->post('username'),
                 'is_logged_in' => true 
            );

           $this->session->set_userdata($data);
         redirect('sessionController/dashboard_area');
    }
    else
     {
        $this->index();
    }
}
function logout()
{
    $this->session->sess_destroy();
    $this->index();
}
}



?>

配置文件

   $config['base_url']  = 'http://hello.hostingsiteforfree.com/';
   $config['index_page'] = 'index.PHP';

解决方法:

由于您没有任何.htaccess来编辑网址,因此您必须添加index.PHP
调用

http://hello.hostingsiteforfree.com/index.PHP/loginController

我尝试通过上面的网址访问它,但它可以正常工作,但是数据库连接设置不正确

在您的配置文件中,其中有$config [‘index_page’] =”如果为空,则向其中添加index.PHP

检查以查看是否有效

大佬总结

以上是大佬教程为你收集整理的php-找不到404页面未找到您请求的页面.代码点火器全部内容,希望文章能够帮你解决php-找不到404页面未找到您请求的页面.代码点火器所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: