⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.124
Server IP:
50.28.103.30
Server:
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software:
nginx/1.28.0
PHP Version:
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
wwwroot
/
china-democracyparty.com
/
2
/
admin
/
View File Name :
settings.php
<?php require_once __DIR__ . '/../includes/auth.php'; require_once __DIR__ . '/../config/sql.php'; require_once __DIR__ . '/../includes/functions.php'; check_csrf(); // Simple single-row settings: site_name, hero_text if($_SERVER['REQUEST_METHOD']==='POST'){ $site_name = trim($_POST['site_name'] ?? ''); $hero_text = trim($_POST['hero_text'] ?? ''); $exists = $conn->query("SELECT id FROM settings LIMIT 1")->fetch_assoc(); if($exists){ $stmt = $conn->prepare("UPDATE settings SET site_name=?, hero_text=? WHERE id=?"); $id = (int)$exists['id']; $stmt->bind_param("ssi", $site_name, $hero_text, $id); $stmt->execute(); $stmt->close(); } else { $stmt = $conn->prepare("INSERT INTO settings(site_name, hero_text) VALUES(?,?)"); $stmt->bind_param("ss", $site_name, $hero_text); $stmt->execute(); $stmt->close(); } header("Location: /admin/settings.php"); exit; } $settings = $conn->query("SELECT * FROM settings LIMIT 1")->fetch_assoc() ?: ['site_name'=>'中国自由民主','hero_text'=>'推动自由、民主、法治与人权。']; $page_title = '站点设置'; include __DIR__ . '/../includes/header.php'; ?> <h1 class="h4 mb-3">站点设置</h1> <form method="post" class="mx-auto" style="max-width:720px;"> <input type="hidden" name="csrf" value="<?php echo h(csrf_token()); ?>"> <div class="mb-3"> <label class="form-label">站点名称</label> <input name="site_name" class="form-control" value="<?php echo h($settings['site_name'] ?? ''); ?>"> </div> <div class="mb-3"> <label class="form-label">首页横幅文案</label> <textarea name="hero_text" class="form-control" rows="3"><?php echo h($settings['hero_text'] ?? ''); ?></textarea> </div> <button class="btn btn-primary">保存</button> </form> <?php include __DIR__ . '/../includes/footer.php'; ?>