Gestionnaire de fichiers - Editer - /home/kridsana/webapp.cm.in.th/663012801/u66301280023/p003/districts.php
Arrière
<!DOCTYPE html> <html lang="th"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Districts</title> <style> body { font-family: Arial, sans-serif; background-color: #000000; margin: 0; padding: 20px; display: flex; justify-content: center; align-items: flex-start; height: 100vh; } .container { background-color: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 0 10px #FFFFFF } table { width: 100%; border-collapse: collapse; } table, th, td { border: 1px solid #ddd; } th, td { padding: 8px; text-align: left; } th { background-color: #696969; color: white; } .button { background-color: #4682B4; color: #fff; border: none; padding: 5px 10px; border-radius: 5px; cursor: pointer; } .button:hover { background-color: #0056b3; } .back-button { background-color: #6495ED; color: #fff; border: none; padding: 5px 10px; border-radius: 5px; cursor: pointer; margin-bottom: 20px; } .back-button:hover { background-color: #483D8B; } </style> </head> <body> <div class="container"> <a href="Index.php" class="back-button">ย้อนกลับหน้าหลัก</a> <table> <tr> <th>ID</th> <th>Thai Name</th> <th>English Name</th> <th>Action</th> </tr> <?php $servername = "localhost"; $username = "u66301280023"; $password = "@2566"; $dbname = "u66301280023"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $province_id = $_POST['province_id']; $sql = "SELECT id, name_in_thai, name_in_english FROM districts WHERE province_id = ? ORDER BY id ASC"; $stmt = $conn->prepare($sql); $stmt->bind_param("i", $province_id); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows > 0) { // output data of each row while ($row = $result->fetch_assoc()) { echo "<tr>"; echo "<td>" . $row["id"] . "</td>"; echo "<td>" . $row["name_in_thai"] . "</td>"; echo "<td>" . $row["name_in_english"] . "</td>"; echo "<td><form action='subdistricts.php' method='POST' style='display:inline;'>"; echo "<input type='hidden' name='district_id' value='" . $row['id'] . "'>"; echo "<button type='submit' class='button'>เลือก</button>"; echo "</form></td>"; echo "</tr>"; } } else { echo "<tr><td colspan='4'>0 results</td></tr>"; } $conn->close(); ?> </table> </div> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Génération de la page: 0.25 |
proxy
|
phpinfo
|
Réglages