按照老師的代碼打,老是報錯是怎么回事
<?php
require_once('function.php');
$controllerAllow=array('test','index');
$methodAllow=array('test','index','show');
$controller=in_array($_GET['controller'],$controllerAllow)?daddslashes($_GET['controller']):'index';
$method=in_array($_GET['method'],$methodAllow)?daddslashes($_GET['method']):'index';
C($controller,$method);
?>
<?php
function C($name,$method){
require_once('/libs/Controller/' .$name. 'Controller.class.php');//引入controller類
eval('$obj=new '.$name.'Controller();$obj->'.$method.'();');
function M($name){
require_once('/libs/Model'.$name.'Model.class.php');
eval('$obj=new '.$name.'Model;');
return $ogj;
}
function V($name){
require_once('/libs/View'.$name.'View.class.php');
eval('$obj=new' .$name.'View();');
return $obj;
}
//轉義字符,過濾非法字符
function daddslashes($str){
return(!get_magic_quotes_gpc())?addslashes($str):$str;
}
}
?>
2018-07-03
這是文件目錄
2018-07-03
你文件的位置確定沒錯?提示找不到目錄文件