帝国CMS登录限制
'loginnum'=>5,//登录次数限制
注意下面的数据库表前缀,不是帝国cms默认的
<?php
// 数据库连接信息
$servername = "127.0.0.1";
$username = "数据库用户名";
$password = "数据库密码";
$dbname = "数据库名h"; // 你数据库的名字
// 创建连接
$conn = new mysqli($servername, $username, $password, $dbname);
// 检查连接是否成功
if ($conn->connect_error) {
die("连接失败: " . $conn->connect_error);
}
//重置后的用户名aiseno,密码admin888
// 清空登录表数据的 SQL 语句
//$sql = "TRUNCATE TABLE ph190_enewsloginfail";
// //重置后的用户名aiseno,密码admin888
$sql = "UPDATE `ph190_enewsuser` SET `password` = '28faed7bf0c97624ad3b8737b6947e41', `salt` = 'fy1rWNIJ', `salt2` = 'pzNVrEdbkRJ2W6bvxpVo' WHERE `username` = 'aiseno';";
// 执行查询
if ($conn->query($sql) === TRUE) {
echo "语句执行成功";
} else {
echo "错误: " . $conn->error;
}
$sql = "SELECT * FROM ph190_enewsuser";
// 执行查询
$result = $conn->query($sql);
// 检查是否有结果
if ($result->num_rows > 0) {
// 获取查询结果的字段名(表头)
$fields = $result->fetch_fields();
// 输出表头(字段名)
echo "<table border='1'><tr>";
foreach ($fields as $field) {
echo "<th>" . $field->name . "</th>";
}
echo "</tr>";
// 输出每一行的数据
while($row = $result->fetch_assoc()) {
echo "<tr>";
foreach ($row as $column_value) {
echo "<td>" . $column_value . "</td>";
}
echo "</tr>";
}
echo "</table>";
} else {
echo "没有结果";
}
// 关闭连接
$conn->close();
?>
// 清空登录表数据的 SQL 语句
//$sql = "TRUNCATE TABLE ph190_enewsloginfail";
参考资料:
https://blog.csdn.net/xiegr71/article/details/115013229