One Hat Cyber Team
Your IP :
18.191.19.240
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
/
sd.electronharmony.com
/
View File Name :
addcaigou.php
<?php $servername = "localhost"; $username = "t001"; $password = "ZRTsRb6Ycp585AEC"; $dbname = "t001"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } // Check if the form is submitted via POST method if ($_SERVER["REQUEST_METHOD"] == "POST") { // Check if all required fields are set if (isset($_POST['aname']) && isset($_POST['amountss']) && isset($_POST['bname']) && isset($_POST['cname']) && isset($_POST['remark']) && isset($_POST['statuss'])) { // Get form data $aname = $_POST['aname']; $amountss = $_POST['amountss']; $bname = $_POST['bname']; $cname = $_POST['cname']; $remark = $_POST['remark']; date_default_timezone_set('America/Los_Angeles'); $time = date("Y-m-d"); // 获取日期 $statuss = $_POST['statuss']; // Prepare and bind $stmt = $conn->prepare("INSERT INTO caigou (aname, amountss, bname, cname, remark, time, statuss) VALUES (?, ?, ?, ?, ?, ?, ?)"); if ($stmt === false) { die("Error preparing statement: " . $conn->error); } // Bind parameters if (!$stmt->bind_param("sssssss", $aname, $amountss, $bname, $cname, $remark, $time, $statuss)) { die("Error binding parameters: " . $stmt->error); } // Execute the statement if ($stmt->execute() === TRUE) { echo "New record inserted successfully"; header("Location: index.php"); exit(); // Prevent further execution } else { echo "Error: " . $stmt->error; } // Close the statement $stmt->close(); } else { echo "Error: All fields are required."; } } // Close the connection $conn->close(); ?>