PHP Gallery Assignment

(10 points) Image Gallery Search: The following HTML snippet is the skeleton of a simple search page for an image gallery. The gallery stores all of its images in a directory called images. Write a PHP program called search.php to implement the searching feature. An image is considered a “match” to the search string if the name of the image contains the entirety of the search string. For example, a query of “tea” might match “tea.jpg” or “steamboat.jpg”. The search should be case-insensitive, and you should eliminate the whitespace surrounding a query before processing it. You should output an unordered list of links to all matches. A blank query should return no results. You may assume there are only image files in the images directory and you should prepare a set of images for testing. Your submission should include the PHP code as well as the html code and images files you use for testing.

 

(10 points) Image Gallery Search, revisited: Modify your solution to the Image Gallery Search problem to account for a smarter search algorithm and a more appealing results page: • Instead of matching only image names that contain the exact search string, an image is considered a match if it contains any of the terms in the search string. You should treat phrases wrapped in quotation marks as a single term. For example, searchTerms("curious george") returns {"curious", "george"} and searchTerms(‘"The Man with the Yellow Hat"’) returns {"The Man with the Yellow Hat"}. • Instead of outputting a list of matched image names, output thumbnails of the matched images that link to the full-sized image. The thumbnails should be 100px in height. • Your submission should include the PHP code as well as the html code and images files you use for testing.

Need a custom answer at your budget?

This assignment has been answered 4 times in private sessions.

© 2024 Codify Tutor. All rights reserved