api file is error
我用这里的办法做了个新自定义接口页面
https://www.xunruicms.com/wenda/24462.html
之前使用正常的
现在突然访问接口页面 www.xxxx.com/go.php?id=2910 的时候,怎么提示
api file is error
请问这是什么原因呢
是因为版本升级了吗?应该怎么处理
下面是自定义页面的代码文件如下
根目录go.php
<?php
/**
* 自定义程序
*/
define('IS_API', basename(__FILE__, '.php')); // 项目标识
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); // 该文件的名称
require((dirname(__FILE__)).'/index.php'); // 引入主文件插件目录/dayrui/My/Api/go.php
<?php
/**
* 自定义程序的控制器代码
这里写php代码,基于控制器类
*/
$id = intval($_GET['id']);
$data = \Phpcmf\Service::M()->table_site("sp")->get($id); // 这里吧demo改成你的模块目录名称
$url = $data['sptklj'];
// 输出url看看对不对,这里可以改进为301跳转等等,自由发挥
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="robots" content="noindex, nofollow" />
<meta http-equiv="Refresh" content="0.1;url=<?php echo $url;?>"/>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?a1c4b380bbc0d2125ba394767c5ec8f4";
var s = document.getElementsByTagName("script")[0];
s[xss_clean].insertBefore(hm, s);
})();
</script>
</head>
<body>
<div style="width:300px;height:100px;margin:0 auto;padding:50px 0; text-align:center">页面跳转中,敬请稍候...</div>
</body>
</html>