Advertisement
Guest User

Untitled

a guest
May 21st, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. <?php
  2. if (isset($_GET['categories']) && isset($_GET['tags']) && isset($_GET['months'])) {
  3.     $categoryInput = htmlspecialchars($_GET['categories']);
  4.     $categories = explode(', ', $categoryInput);
  5.     $tagsInput = htmlspecialchars($_GET['tags']);
  6.     $tags = explode(', ', $tagsInput);
  7.     $monthsInput = htmlspecialchars($_GET['months']);
  8.     $months = explode(', ', $monthsInput);
  9.  
  10.     echo "<h2>Categories</h2>";
  11.     echo "<ul>";
  12.     foreach ($categories as $category) {
  13.         echo "<li>$category</li>";
  14.     }
  15.     echo "</ul>";
  16.     echo "<h2>Tags</h2>";
  17.     echo "<ul>";
  18.     foreach ($tags as $tag) {
  19.         echo "<li>$tag</li>";
  20.     }
  21.     echo "</ul>";
  22.     echo "<h2>Months</h2>";
  23.     echo "<ul>";
  24.     foreach ($months as $month) {
  25.         echo "<li>$month</li>";
  26.     }
  27.     echo "</ul>";
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement