<?php require 'Clothes.php'; $indexName = "WomenClothes"; $objClothes = new Clothes($indexName); $question = $_GET["question"]; if (strlen($question) > 0) { $infoClothes = $objClothes->getInformationClothes($question, 5); foreach ($infoClothes as $clothes) { echo $clothes["name"]; #." $". $clothes["price"]." ".$clothes["designer"]; echo "<br>"; } }
<?php require 'Clothes.php'; $indexName = "WomenClothes"; $objClothes = new Clothes($indexName); $infoClothes = $objClothes->getInformationClothes("skirt", 10); $infoClothes = $objClothes->arrayToJSON($infoClothes); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <title> Get clothes </title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> <style> #livesearch { color:red; } </style> </head> <body> <div class="container"> <h1>Escenario 1 <small>La consulta es "dress". </small></h1> <?php //echo $infoClothes; ?> <?php //if ($infoClothes == "Please, try with other option"):