diff --git a/chapter11/project2/browse-images.php b/chapter11/project2/browse-images.php index 293a046c4dd9442da65c93f86c381dc412e6db84..ba0d8e0040eac8b0a0c40ca66a850e06b3abd6a3 100644 --- a/chapter11/project2/browse-images.php +++ b/chapter11/project2/browse-images.php @@ -56,7 +56,7 @@ $sqlCitiesMatch = $pdo->query($sql); - if ($_SERVER['REQUEST_METHOD'] == 'GET') { + /*if ($_SERVER['REQUEST_METHOD'] == 'GET') { echo "<br>"; if ( isset($_GET['city']) ) { echo $_GET['city']; @@ -66,7 +66,7 @@ echo $_GET['country']; } echo "<br>"; - } + }*/ # Returns filtered City/Country. @@ -127,7 +127,6 @@ WHERE GeoCountries.ISO = TravelImageDetails.CountryCodeISO AND GeoCities.GeoNameID = TravelImageDetails.CityCode AND TravelImage.ImageID = TravelImageDetails.ImageID;"; - echo $sql; $sqlFilterMatch = $pdo->query($sql); ?> @@ -196,9 +195,9 @@ #GetDBFilterMatch(); if ($sqlFilterMatch) { while ($row = $sqlFilterMatch->fetch()) { - echo "<figure style='display: inline-block; padding-left: 1%; padding-right: 1%; width=150px;'>"; - echo "<a href='" . $row['ImageID'] . "'><img src='images/travel/" . $row['Path'] . "'></a>"; - echo "<figcaption style='max-width: 150px;'>" . $row['Title'] . "</figcaption>"; + echo "<figure style='display: inline-block; padding: 1%; width=150px; background-color: #fff; margin: 15px;'>"; + echo "<a href='" . $row['ImageID'] . "'><img src='images/travel/square/" . $row['Path'] . "'></a>"; + echo "<figcaption style='max-width: 150px; text-align: center; font-size: 0.75em;'>" . $row['Title'] . "</figcaption>"; echo "</figure>"; } } else {