1 Star 0 Fork 0

Blood.Cold/nexusphp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
takestaffmess.php 1.13 KB
一键复制 编辑 原始数据 按行查看 历史
xiaomlove 提交于 2020-12-26 01:42 . init
<?php
require "include/bittorrent.php";
if ($_SERVER["REQUEST_METHOD"] != "POST")
stderr("Error", "Permission denied!");
dbconn();
loggedinorreturn();
if (get_user_class() < UC_ADMINISTRATOR)
stderr("Sorry", "Permission denied.");
$sender_id = ($_POST['sender'] == 'system' ? 0 : (int)$CURUSER['id']);
$dt = sqlesc(date("Y-m-d H:i:s"));
$msg = trim($_POST['msg']);
if (!$msg)
stderr("Error","Don't leave any fields blank.");
$updateset = $_POST['clases'];
if (is_array($updateset)) {
foreach ($updateset as $class) {
if (!is_valid_id($class) && $class != 0)
stderr("Error","Invalid Class");
}
}else{
if (!is_valid_id($updateset) && $updateset != 0)
stderr("Error","Invalid Class");
}
$subject = trim($_POST['subject']);
$query = sql_query("SELECT id FROM users WHERE class IN (".implode(",", $updateset).")");
while($dat=mysql_fetch_assoc($query))
{
sql_query("INSERT INTO messages (sender, receiver, added, subject, msg) VALUES ($sender_id, $dat[id], $dt, " . sqlesc($subject) .", " . sqlesc($msg) .")") or sqlerr(__FILE__,__LINE__);
}
header("Refresh: 0; url=staffmess.php?sent=1");
?>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/scruixin_Blood/nexusphp.git
[email protected]:scruixin_Blood/nexusphp.git
scruixin_Blood
nexusphp
nexusphp
master

搜索帮助