HEX
Server: Apache/2.4.37 (CentOS Stream) OpenSSL/1.1.1k
System: Linux ysnet.com.tw 4.18.0-553.5.1.el8.x86_64 #1 SMP Tue May 21 05:46:01 UTC 2024 x86_64
User: test (521)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /var/www/test/discordgetoff.php
<?php
// 获取传递的参数
$mess = isset($_GET['mess']) ? $_GET['mess'] : '';
$every = "@everyone";

// 设置消息内容
$message = "**$mess**";

// Discord Webhook URL
$webhook_url = "https://discord.com/api/webhooks/1310923081669414962/qcMJ-DHsuQX7D2XncyZW8BHl_KoXR9ey1mwDlF8r799KV_OiaonTezgOVfqAB9_-Alcm";

// 创建 JSON 数据(包含 Embed)
$json_data = json_encode([
    "embeds" => [
        [
            "title" => $message,
            "description" =>  $every,  // 消息内容
            "color" => 16711680,  // 十进制颜色值(此处为红色)
        ]
    ]
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);

// 使用 cURL 发送请求到 Discord Webhook
$ch = curl_init($webhook_url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// 执行请求并关闭 cURL
$response = curl_exec($ch);
curl_close($ch);

// 输出响应(可选,调试用)
echo $response;
?>