One Hat Cyber Team
Your IP :
3.133.106.206
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.24.0
PHP Version :
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
wwwroot
/
ef.electronharmony.com
/
1
/
T5
/
View File Name :
submit_powerball.php
<?php // 包含数据库配置文件 include 'db_config.php'; if ($_SERVER["REQUEST_METHOD"] == "POST") { // 获取表单输入 $num1 = filter_input(INPUT_POST, 'num1', FILTER_VALIDATE_INT); $num2 = filter_input(INPUT_POST, 'num2', FILTER_VALIDATE_INT); $num3 = filter_input(INPUT_POST, 'num3', FILTER_VALIDATE_INT); $num4 = filter_input(INPUT_POST, 'num4', FILTER_VALIDATE_INT); $num5 = filter_input(INPUT_POST, 'num5', FILTER_VALIDATE_INT); $powerball = filter_input(INPUT_POST, 'powerball', FILTER_VALIDATE_INT); // 自定义日期输入 $custom_date_input = filter_input(INPUT_POST, 'custom_date', FILTER_SANITIZE_SPECIAL_CHARS); // 转换日期为标准格式 $custom_date = false; try { $date = new DateTime($custom_date_input); $custom_date = $date->format('Y-m-d'); // 转换为 YYYY-MM-DD 格式 } catch (Exception $e) { // 日期格式无效 echo "Invalid date format! Please enter a valid date."; exit; } // 验证输入是否有效 if ( $num1 >= 1 && $num1 <= 69 && $num2 >= 1 && $num2 <= 69 && $num3 >= 1 && $num3 <= 69 && $num4 >= 1 && $num4 <= 69 && $num5 >= 1 && $num5 <= 69 && $powerball >= 1 && $powerball <= 26 && $custom_date ) { try { // 准备 SQL 语句 $stmt = $conn->prepare("INSERT INTO powerball_entries (num1, num2, num3, num4, num5, powerball, custom_date) VALUES (:num1, :num2, :num3, :num4, :num5, :powerball, :custom_date)"); // 绑定参数 $stmt->bindParam(':num1', $num1, PDO::PARAM_INT); $stmt->bindParam(':num2', $num2, PDO::PARAM_INT); $stmt->bindParam(':num3', $num3, PDO::PARAM_INT); $stmt->bindParam(':num4', $num4, PDO::PARAM_INT); $stmt->bindParam(':num5', $num5, PDO::PARAM_INT); $stmt->bindParam(':powerball', $powerball, PDO::PARAM_INT); $stmt->bindParam(':custom_date', $custom_date, PDO::PARAM_STR); // 执行 SQL $stmt->execute(); header("Location: index.php"); echo "Powerball entry added successfully!"; } catch (PDOException $e) { echo "Error: " . $e->getMessage(); } } else { echo "Invalid input! Please ensure numbers are within the correct range and the date is valid."; } } ?>