One Hat Cyber Team
Your IP :
3.15.238.90
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
/
T1
/
View File Name :
xs.php
<?php // 数据库连接配置 $servername = "localhost"; $username = "tfrom"; // 替换为你的数据库用户名 $password = "kt7Y5dkKDn6cartm"; // 替换为你的数据库密码 $dbname = "tfrom"; // 创建数据库连接 $conn = new mysqli($servername, $username, $password, $dbname); // 检查连接是否成功 if ($conn->connect_error) { die("连接失败: " . $conn->connect_error); } // SQL 查询从数据库中获取所有数据 $sql = "SELECT field_name, field_value FROM submissions"; $result = $conn->query($sql); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>编辑表单数据</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"> </head> <body> <div class="container my-5"> <h2 class="mb-4">编辑表单数据</h2> <!-- 表单 --> <form action="update_data.php" method="POST"> <?php if ($result->num_rows > 0) { // 遍历并为每个字段生成一个input输入框 while($row = $result->fetch_assoc()) { echo '<div class="mb-3">'; echo '<label class="form-label">' . htmlspecialchars($row["field_name"]) . '</label>'; echo '<input type="text" class="form-control" name="' . htmlspecialchars($row["field_name"]) . '" value="' . htmlspecialchars($row["field_value"]) . '">'; echo '</div>'; } } else { echo '<p>没有找到提交的数据。</p>'; } // 关闭数据库连接 $conn->close(); ?> <button type="submit" class="btn btn-primary">保存修改</button> </form> </div> </body> </html>