📄 link.php
字号:
<?
define('DISCUZ_ROOT', './');
//去除HTML标记
function Html2Text($txt)
{
$txt = str_replace(" "," ",$txt);
$txt = str_replace("'"," ",$txt); //加强下单引号过滤
$txt = str_replace("<","<",$txt);
$txt = str_replace(">",">",$txt);
$txt = preg_replace("/[\r\n]{1,}/isU","<br/>\r\n",$txt);
return $txt;
}
$name=$_POST["othername"];
$url=trim($_POST["otherurl"]);
$logo=trim($_POST["otherlogo"]);
$description=$_POST["otherdescription"];
if ($name) {
$name=Html2Text($name);
}
else{
die("网站名称必填");
}
if (!preg_match ("/((http)|(https)):\/\/[a-z0-9-]+\.[a-z0-9-]+\.[a-z]{2,3}(\.[a-z]{2,3})?/i",$url)) {
die("网站路径不正确-".$url);
}
if ($logo)
{
if (!preg_match ("/http:\/\/[a-z0-9-]+\.[a-z0-9-]+\.[a-z]{2,3}(\.[a-z]{2,3})?[\w_\/]+\.((gif)|(jpg)|(png))/i", $logo)) {
die("logo格式不正确");
}
}
$description =Html2Text($description);
$count = $name ."!!".$url."!!".$logo."!!".$description."<end_next>";
$link_txt= DISCUZ_ROOT.'plugins/friendlink/link_txt.txt';
if($fp = fopen($link_txt, 'a')) {
fwrite($fp, $count);
fclose($fp);
}
print "<script>alert(\"恭喜!您的站点提交成功,我们会尽快通过审核!\");window.location.href=\"index.php\"</script>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -