forked from komalkhatod1105/One-Stop-Guide
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcity.php
More file actions
37 lines (33 loc) · 961 Bytes
/
Copy pathcity.php
File metadata and controls
37 lines (33 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
include 'dbconnect.php';
$city = $_GET['city']; // e.g., "Ajmer"
$sql = "SELECT * FROM city_data WHERE city_name = '$city'";
$result = mysqli_query($conn, $sql);
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo $city; ?> - City Guide</title>
<style>
body { font-family: Arial; padding: 20px; }
.card { border: 1px solid #ccc; margin: 10px; padding: 15px; border-radius: 8px; }
</style>
</head>
<body>
<h1>Welcome to <?php echo $city; ?></h1>
<?php
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
echo "<div class='card'>";
echo "<h2>" . $row['place_name'] . "</h2>";
echo "<p>Type: " . $row['place_type'] . "</p>";
echo "<p>Description: " . $row['description'] . "</p>";
echo "</div>";
}
} else {
echo "<p>No data found for this city.</p>";
}
mysqli_close($conn);
?>
</body>
</html>