短链网站报错修复
本文最后更新于139 天前,其中的信息可能已经过时,如有错误请发送邮件到mail@bfzw.top

加密访问报错

短链网站在访问输入密码页面时提示

Undefined array key "txtpass" in /www/wwwroot/xza.norc.cn/link.php on line 32

是因为下面这段代码中的txtpass在刚载入时并未定义,只有页面加载完成后才存在“txtpass”。因此$_POST在第一次加载时不能正常读取“txtpass”.

if ($_POST['txtpass'] != $pass) {
    include "functions/password.php";
} else {
    include "functions/redirect.php";
}

因此把上面代码修改为下面的内容,来避免第一次读取“txtpass”失败。

if (isset($_POST['txtpass']) && $_POST['txtpass'] == $pass) {
    include "functions/redirect.php";
} else {
    include "functions/password.php";
}

翻页报错

在管理面板浏览所有短链记录,点击下一页报错

Fatal error: Uncaught Error: Array callback must have exactly two elements in /www/wwwroot/xza.norc.cn/admn/links.php:78 Stack trace: #0 {main} thrown in /www/wwwroot/xza.norc.cn/admin/links.php on line 78

根据提示中提供的代码位置和错误信息,问题出现在links.php的第78行。它试图使用 $_GET{'page'},但这样写是错误的。在PHP中,数组和字符串的键名应该用引号包围,并且使用方括号 [] 而不是大括号 {} 来访问数组元素。

因此改为以下代码

if (isset($_GET['page'])) { //get the current page 
    $page = $_GET['page'] + 1;
    $offset = $rec_limit * $page;
} else {
    // show first set of results
    $page = 0;
    $offset = 0;
}

翻页首页错误显示空白图标

打开links.php文件(路径:./admin/links.php),找到以下代码

echo @"<li><a href=\"$_PHP_SELF?page=$page\"> <li>后面一个</a></li>";

修改为

echo @"<li><a href=\"$_PHP_SELF?page=$page\"> 后面一个</a></li>";

去掉缩短按钮多出的阴影

打开style.css文件(路径:./css/style.css),找到对应参数,并修改为以下值

修改“.sized”

.sized {
	max-height: 125px;
	max-width: 100%;
	margin-bottom: 5em;
}

修改“.cz-shorten-input”

.cz-shorten-input {
	/*margin-top: 20px;*/
	height: 50px;
	font-size: 20pt;
}

修改“.cz-shorten-btn”

.cz-shorten-btn {
	/*margin-top: 20px;*/
	height: 50px;
	transition: all 250ms ease;
	outline: none;
}
点击获取当前页面短链
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇