D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
home
/
markniuj
/
bazmeasar.com
/
favorite
/
Filename :
shc.php
back
Copy
<?php include "../config.php"; // Retrieve all available categories $category_query = "SELECT catid, catname FROM categories"; $category_result = $conn->query($category_query); // Handle form submission to select favorite categories if ($_SERVER["REQUEST_METHOD"] == "POST") { // Retrieve the selected favorite categories from the form $favorite_categories = $_POST['favorite_categories']; // Save the selected favorite categories in the database (you can update a table with admin preferences) // Implement the database update code here // Redirect to the admin dashboard or another page header("Location: admin_dashboard.php"); exit; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Select Favorite Categories</title> </head> <body> <h1>Select Your 6 Favorite Categories</h1> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <ul> <?php while ($category_row = $category_result->fetch_assoc()) { $catid = $category_row['catid']; $catname = $category_row['catname']; echo "<li><input type='checkbox' name='favorite_categories[]' value='$catid'>$catname</li>"; } ?> </ul> <input type="submit" value="Save Favorite Categories"> </form> </body> </html>