hjkhhrterwefdgdfgdfgdfgdgdfgdfgdsvstertrt
bnmbertsdfsdfgdfgdfgfffdgdfgdfgrtdfg
/
home
/
u254050281
/
domains
/
indiannadarcouncil.in
/
public_html
/
Upload FileeE
HOME
<?php $servername = "localhost"; $username = "u254050281_Wl8K9"; $password = "Indianadar@2024"; $dbname = "u254050281_iTofe"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } // SQL query to fetch announcements $sql = "SELECT content FROM announcements ORDER BY created_at DESC"; $result = $conn->query($sql); $announcements = []; if ($result->num_rows > 0) { // Fetch all rows while ($row = $result->fetch_assoc()) { $announcements[] = $row['content']; } } $conn->close(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Announcements Sidebar</title> <style> body { font-family: Arial, sans-serif; margin: 0; padding: 0; display: flex; } .sidebar { width: 250px; background-color: #f4f4f4; padding: 15px; box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1); } .sidebar h2 { margin-top: 0; } .announcement-list { list-style: none; padding: 0; margin: 0; } .announcement-list li { border-bottom: 1px solid #ddd; padding: 10px 0; } .announcement-list li:last-child { border-bottom: none; } </style> </head> <body> <div class="sidebar"> <h2>Announcements</h2> <ul class="announcement-list"> <?php foreach ($announcements as $announcement): ?> <li><?php echo htmlspecialchars($announcement); ?></li> <?php endforeach; ?> </ul> </div> <div class="content" style="flex: 1; padding: 20px;"> <!-- Main content goes here --> </div> </body> </html>