Using Version 1.5 of SurnameSearch.php as a basis, complete the code to display the result set across multiple pages. In particular, include the following features. (a) Validate string and numeric...


Using Version 1.5 of SurnameSearch.php as a basis, complete the code to display the result set across multiple pages. In particular, include the following features.


(a) Validate string and numeric data using the functions you wrote in Exercise 4.13 (d). Deal with search criteria that include single apostrophes in the string literal.


(b) Display a count of the number of matching rows at the start of the page. (Hint: The PHP built-in function mysql_num_rows()counts the number of rows in the result set. If there is a limit clause, then this will not be the total number of matching rows. Try using an aggregate query.)


(c) Display the rows in an HTML table element so that, for each row, the forename, surname and e-mail and the ‘Full details’ hyperlink appear in separate columns. Alternatively, if you are familiar with CSS, use CSS to achieve this layout. (Hint: See solution to 4.14 (d)). Consider writing a suitable function to do this for any result set.


(d) Add a ‘Prev’ hyperlink, allowing users to navigate to the previous page of the result set. This link should not be enabled on the first page, nor should the ‘Next’ link be enabled on the last page.


(e) Make the forename column heading a hyperlink. When this hyperlink is clicked on, redisplay the search results ordered by forename. Allow end users to cycle through three states – ascending order, descending order and unordered. Do the same for the surname and e-mail columns.


(f) The web page now includes up to six hyperlinks, each encoding different items of application state. The page navigation and ordering hyperlinks must be properly synchronized. Critically evaluate how effective URL rewriting is as a mechanism for maintaining application state as the number of items increases.



May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here