Home  >  Article  >  Backend Development  >  Brophp setting 404 method sharing_PHP tutorial

Brophp setting 404 method sharing_PHP tutorial

WBOY
WBOYOriginal
2016-07-14 10:06:521033browse

Today a classmate asked me how to set 404 in brophp. I will share the method here
1. Prepare a 404 page template yourself and place it under public in the root directory. Of course, you can define the path yourself.
2. First add such a method in action.class.php:
static public function _404(){
header("HTTP/1.0 404 Not Found");
header("status: 404 Not Found");
$my = new self();
$my->display('public/404');
}

3. Find $srccontrolerfile = APP_PATH."controls/".strtolower($_GET["m"]).".class.php" in brophp/brophp.php; add the following code after it:
if(!file_exists($srccontrolerfile)){
Action::_404();
}

4, then open action.class.php and find Debug::addmsg("There is no {$_GET["a"]} operation!") ;
Add above or below this line:
self::_404();
OK, done!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477915.htmlTechArticleToday a classmate asked me how to set up 404 in brophp. Here I will share method 1. Prepare a 404 page template yourself. Place it under public in the root directory. Of course, you can define the path yourself...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn