Home > Backend Development > PHP Tutorial > Brophp setting 404 method sharing_PHP tutorial

Brophp setting 404 method sharing_PHP tutorial

WBOY
Release: 2016-07-14 10:06:52
Original
1095 people have browsed it

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...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template