<?php require_once "../inc/config.php"; $search_term = ""; if (isset($_GET["s"])) { $search_term = trim($_GET["s"]); if ($search_term != "") { require_once ROOT_PATH . "inc/products.php"; $products = get_products_search($search_term); } } else { } $pageTitle = "Search"; $section = "search"; include ROOT_PATH . "inc/header.php"; ?> <div class="section shirts search page"> <div class="wrapper"> <h1>Search</h1> <form method="GET" action="./"> <input type="text" name="s" placeholder="search" value="<?php echo htmlspecialchars("{$search_term}"); ?> "> <input type="submit" value="Go"> </form>
<?php /* This file contains instructions for three different states of the form: * - Displaying the initial search form * - Handling a form submission and ... * - ... displaying the results if matches are found. * - ... displaying a "no results found" message if necessary. */ // if a non-blank search term is specified in // the query string, perform a search $search_term = ""; if (isset($_GET["s"])) { $search_term = trim($_GET["s"]); if ($search_term != "") { include "inc/technologies-data.php"; $technologies = get_products_search($search_term); } } $pageTitle = "Search"; $section = "search"; include "inc/header.php"; ?> <div class="section shirts search page"> <div class="wrapper"> <h1>Search</h1> <form method="get">