找回密码
 注册
搜索
免费空间 免费域名 免费AI 老牌主机商首月仅1美分!27美元/年!Spaceship优惠码 Namecheap优惠码阿里云2核2G3M新老续费同享99元/年!
楼主: efc88ff45580620

[问题求助] Beget空间无法安装typecho和Discuz的解决办法

[复制链接]
 楼主| 发表于 2023-9-5 21:09:03 | 显示全部楼层
jason 发表于 2023-9-5 20:57
euorg在我这里x了,打不开,不方便

移动封了一段时间,后来逐渐解封了,难道又不行了?
发表于 2023-9-5 21:16:42 | 显示全部楼层
efc88ff45580620 发表于 2023-9-5 21:09
移动封了一段时间,后来逐渐解封了,难道又不行了?

是的
 楼主| 发表于 2023-9-5 21:52:46 | 显示全部楼层

eu.org域名虽然有点丑,但是很坚挺,能免费这么多年也是没谁了
 楼主| 发表于 2023-9-6 12:47:13 | 显示全部楼层
安装了ty博客,ty博客有的文章无法访问,文章明明没有删除却总是跳转提示

404 - 页面没找到

你要查看的页面已被转移或删除了

http://e98676bc.beget.tech

毛子空间的问题太多了!

安装Zblog暂时没有发现问题


 楼主| 发表于 2023-9-6 13:05:53 | 显示全部楼层
发现新问题:
这个内容的文章无法访问!
难道空间还有禁忌词了?
删除了代码就你访问:http://e98676bc.beget.tech/archives/7/
附上代码就无法访问:http://e98676bc.beget.tech/archives/3/

前言

好多短链接网站都消失了,为了安全最好自己建立一个,此代码极为精简。

实现方式

可用于短连接开发

随便找个PHP空间存放即可

<html>
<head>
<meta charset="utf-8"/>
<title>简易·短网址</title>

<!-- 防止post重复提交 -->
<script type="text/javascript">
if(window.history.replaceState)
{
    window.history.replaceState(null, null, window.location.href)
}
</script>
</head>


<?php
//防止频繁提交

session_start();
$seconds = '60';     //时间段[秒]
$refresh = '6';      //提交次数
$blocktime = '600';  //封禁时间

$cur_time = time();

//超过提交频率封禁浏览器 重启浏览器可解封
if($_SESSION['refresh_times'] > 999 && $cur_time - $_SESSION['last_time'] < $blocktime ){
    exit('<p><b>请勿频繁提交,设备已封禁!稍后再试。</b></p>');
}

if(isset($_SESSION['last_time'])){
    $_SESSION['refresh_times'] += 1;
}else{
    $_SESSION['refresh_times'] = 1;
    $_SESSION['last_time'] = $cur_time;
}

if($cur_time - $_SESSION['last_time'] < $seconds){
    if($_SESSION['refresh_times'] >= $refresh){
        //超过提交频率 标记X
        $_SESSION['refresh_times'] = 9999;
    }
}else{
    $_SESSION['refresh_times'] = 0;
    $_SESSION['last_time'] = $cur_time;
}
?>


<?php
//生成随机文件夹(短链接)名称

function GetRandStr($len)
{
$chars = array(
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k",
"l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
"w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G",
"H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R",
"S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2",
"3", "4", "5", "6", "7", "8", "9"
);
$charsLen = count($chars) - 1;
shuffle($chars);
$output = "";
for ($i=0; $i<$len; $i++)
{
$output .= $chars[mt_rand(0, $charsLen)];
}
return $output;
}

//$dirabc = xxxxx;
$dirabc = GetRandStr(4);
$dir123 = rand(0,9);

//当文件夹(短链接)存在时 增加一位
if(!is_dir($dirabc)){
    $shortdir = $dirabc;
} else {
    $shortdir = $dirabc.$dir123;
}
?>


<?php
//判断程序根目录路径

$dirpath = dirname($_SERVER['PHP_SELF']);
$rootpath = dirname($_SERVER['PHP_SELF'])."/";
if ($dirpath == "/"){$rootpath = "/";}
?>


<body>
<p><b>要缩短的 URL(必须包含 http:// 或 https://)</b></p>

<form method="post">
<textarea rows='3' name="url" style="width:100%"></textarea><br/><br/>
<input type="submit" style="font-size:16px;font-weight:900" value="缩短网址"/>
<form><br/><br/>

<?php
if (isset($_POST['url'])){
$origin = $_POST['url'];

    if (strlen($origin) > 10 && strpos($origin, strval("http"))!==false && !is_dir($shortdir)){
    mkdir(iconv("UTF-8", "GBK", $shortdir),0755,true);
    $filename = $shortdir."/index.html";

    file_put_contents($filename,
    '<script type="text/javascript">location.href="'.$origin.'"</script>');
    $shortened = "http://".$_SERVER['HTTP_HOST'].$rootpath.$shortdir;

    echo '<p>原来的 URL:<br/><a href="'.$origin.'" target="_blank">'.$origin.'</a></p>'
         .'<p>缩短的 URL:<br/><a href="'.$shortened.'" target="_blank">'.$shortened.'</a></p>';

    } else {
            echo "<p><b>您输入的URL无效!</b></p>";
    }
}
?>

</body>
</html>
发表于 2023-9-6 14:13:22 | 显示全部楼层
本帖最后由 jason 于 2023-9-6 15:10 编辑
efc88ff45580620 发表于 2023-9-6 13:05
发现新问题:
这个内容的文章无法访问!
难道空间还有禁忌词了?

http://s9600739.beget.tech/viewtopic.php?t=140

没事
 楼主| 发表于 2023-9-6 15:55:36 | 显示全部楼层
jason 发表于 2023-9-6 14:13
http://s9600739.beget.tech/viewtopic.php?t=140

没事

还是ty博客程序兼容的问题,这个破空间
发表于 2023-9-6 17:00:45 | 显示全部楼层
efc88ff45580620 发表于 2023-9-6 13:05
发现新问题:
这个内容的文章无法访问!
难道空间还有禁忌词了?

http://scorn.yaner.cc/index.php/archives/1/
程序没有问题哈,你贴这个要用插入代码的形式,完全没有问题

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
 楼主| 发表于 2023-9-6 19:53:25 | 显示全部楼层
yaner 发表于 2023-9-6 17:00
http://scorn.yaner.cc/index.php/archives/1/
程序没有问题哈,你贴这个要用插入代码的形式,完全没有问 ...

代码格式也是不行,不知道问题出在哪里了,点开的瞬间能看到文章,然后跳转删除状态
发表于 2023-9-6 20:56:18 | 显示全部楼层
efc88ff45580620 发表于 2023-9-6 19:53
代码格式也是不行,不知道问题出在哪里了,点开的瞬间能看到文章,然后跳转删除状态
...

PHP版本搞到最高
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|免费吧论坛

GMT+8, 2024-4-28 07:18 , Processed in 0.028968 second(s), 4 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表