V2EX 09月18日
Typecho首页生成代码错误修正
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

本文针对Typecho首页生成代码中的数组键错误进行原因分析,并提供相应的修正方法。

`<?php

$nowtime=time();

$pastsec = $nowtime - $_GET["t"];

if($pastsec<600){exit; //10 分钟更新一次,时间可以自己调整}ob_start(); //打开缓冲区include("index.php");$content = ob_get_contents(); //得到缓冲区的内容$content .= "\n<script language=javascript src='/index/thumb.png' data-original="html.php?t=".$nowtime.""></script>"; //加上调用更新程序的代码

file_put_contents("index.html",$content);if (!function_exists("file_put_contents")){function file_put_contents($fn,$fs){$fp=fopen($fn,"w+");fputs($fp,$fs);fclose($fp);
}}?>`

以上代码用于生成 typecho 首页 index.html ,运行时提示错误:Warning: Undefined array key "t" in /www/onlineps.top/learn/html.php on line 3求助高手帮我改写以上代码。

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Typecho 代码错误 修正方法 数组键
相关文章