For this assignment, you will create search form and search results page for DVD database. All data and results should be dynamic and come directly from the database.
DVD Search Form Page
- Download starter files: a08-dvd-search.You are welcome to write your own HTML if you wish to get some practice.
- Check for any database errors as shown in lecture (after establishing a connection to the database and then after submitting the SQL to the server).
- DVD Title text field.
- Following drop-downs dynamically populated with data from the database.
- Use primary keys for
- Display the name (genre, rating, etc.) as drop-down options,
- Include All as the first option in each drop-down.
- Award radio buttons:
- Any (records with or without awards),
- Yes (only records with awards),
- No (only records without awards),
- Release date:
- Allow users to choose a date range (from and to)
- Users can fill out one, both or neither fields.
- Submit & Reset buttons.
DVD Search Results Page
- Remember to check for any database errors as shown in lecture.
- Search Form should submit to this page.
- Include “Back to Form” link for users to submit another form.
- Perform all validation as needed.
- Page should still work even if any of the parameters are missing.
- Based on user input, query the database and display correct results.
- Show how many results search query produced.
- For example: Showing 7886 result(s).
- Display following fields in tabular or table format:
- DVD title,
- Release Date,
- Only show DVD results that match the date range user has given.
- If no date fields were submitted, it is ok to show DVDs that do not have a release date.
- Genre (name, not primary key),
- Rating (name, not primary key).
- Tip: Before writing the SQL statement to search,
var_dumpout the variables you are getting passed through from the Search Form. This will help you write out the SQL statement.
Using FileZilla, create
assignment08 directory on itpwebdev.com server within
public_html. Upload all assignment files to that new directory, then link the assignment on your
student_page.html. Do not modify any assignment files after the deadline. The last modified timestamp serves as your submission time.
- Does this form handle any sensitive data?
- Is this data being added to the database?
- Radio buttons also use the HTML attribute
valueto determine which radio button was selected.
- Refer to the DVD database diagram to ensure you are using the correct columns names:
Note: samples below don’t always meet all the requirements. Make sure to follow the requirements rather than solely relying on the samples.