public $tags = array(); public function __construct($title, $description, $author, $date) { $this->title = $title; $this->description = $description; $this->author = $author; $this->date = $date; } } $interface = new databaseInterface(); if (isset($_GET['search'])) { if ($_GET['search'] == 'latest') { if (isset($_GET['tag'])) { $result = $interface->getByTag(htmlspecialchars($_GET['tag']), 'blog_items', 'date'); } else { $result = $interface->getByDate('blog_items'); } } else { if ($_GET['search'] == 'popular') { if (isset($_GET['tag'])) { $result = $interface->getByTag(htmlspecialchars($_GET['tag']), 'blog_items', 'popular'); } else { $result = $interface->getByViews('blog_items'); } } else { $result = $interface->getAll('blog_items'); } } } else { header("Location: Page-blog.php?search=latest&tag=" . $_GET['tag']); }
public $tags = array(); public function __construct($title, $description, $author, $date) { $this->title = $title; $this->description = $description; $this->author = $author; $this->date = $date; } } $interface = new databaseInterface(); if ($_GET['search'] != null) { if ($_GET['search'] == 'latest') { if (isset($_GET['tag'])) { $result = $interface->getByTag(htmlspecialchars($_GET['tag']), 'project_items', 'date'); } else { $result = $interface->getByDate('project_items'); } } else { if ($_GET['search'] == 'popular') { if (isset($_GET['tag'])) { $result = $interface->getByTag(htmlspecialchars($_GET['tag']), 'project_items', 'popular'); } else { $result = $interface->getByViews('project_items'); } } else { $result = $interface->getAll('project_items'); } } } else { header("Location: Page-projects.php?search=latest&tag=" . $_GET['tag']); }