Edition by F. Max Coller
Complete Chapter Solutions Manual
are included (Ch 1 to 12)
** Immediate Download
** Swift Response
** All Chapters included
** Data Files Solutions
,Table of Contents are given below
1. HOW DOES A BROWSER WORK?
2. HTML AND CSS: JUST TEXT IN A TEXT FILE.
3. CREATING AN HTML/CSS MENU.
4. WHAT IS RESPONSIVE DESIGN?
5. WHAT IS JAVASCRIPT?
6. WHAT ARE JAVASCRIPT LIBRARIES?
7. WHAT IS A CONTENT MANAGEMENT SYSTEM?
8. WHY IS WEBSITE SECURITY IMPORTANT?
9. WHAT IS PHP?
10. WHAT IS A DATABASE?
11. CREATING AN HTML FORM USING PHP.
12. HOW DO I GET STARTED?
,Solutions Manual organized in reverse order, with the last chapter displayed first, to ensure that all
chapters are included in this document. (Complete Chapters included Ch12-1)
Solution and Answer Guide
COLLER, WEB DEVELOPMENT: FULL STACK 1E ©24, 9780357673850; Chapter 12: Building a Dynamic
Webpage with a MySQL Database.
TABLE OF CONTENTS
Review Questions ..............................................................................................................................1
Programming Exercises ......................................................................................................................6
Projects .............................................................................................................................................6
REVIEW QUESTIONS
1. Why should you hide the connection error details from the users of your PHP web application and display
only a generic error message instead? (12.1)
a. To keep your users from becoming worried about the problems they are causing in your system
b. To prevent hackers from gaining useful information about the success or failure of their
attempted hacking
c. To keep users from knowing that your system contains errors or bugs
d. To prevent hackers from being able to try to hack your database, since they won’t know if a web
application is using one
Answer: b
Feedback:
a. Incorrect. Your users will know something is wrong when the system doesn’t work, so it is helpful
to display a polite error message.
b. Correct. No useful information should be purposefully displayed to any hacker who is attempting
to infiltrate your system.
c. Incorrect. Your users will already know the system has bugs and errors when it doesn’t work.
d. Incorrect. If tabular data is being displayed in a dynamic web application, the most logical storage
is in a database.
2. What is an associative array? (12.1)
a. A data structure containing multiples of the same type of data like integers or strings
b. A data structure with key/value pairs A data structure used to hold other data structures in
association with each other
c. A data structure that shouldn’t be used any more since newer and more efficient structures have
rendered it obsolete
Answer: b
Feedback:
1
, a. Incorrect. An array is used to store multiples of the same type of data.
b. Correct. An associative array is a data structure that contains named keys instead of an index like a
normal array and data as the values.
c. Incorrect. A data structure like an array can be used to hold other data structures like associative
arrays.
d. Incorrect. Associative arrays are still widely used in PHP.
3. What does the use of an include statement in PHP accomplish? (12.1)
a. Inserts the contents of one row from a table in the database into one row in an associative array
in PHP
b. Makes the contents of the file named after the include command available to the code in the
page where the command is used
c. Imports the text of the file named after the include command into the file where the
command is used
d. Exports the functions in the file where the command is used into the file named after the
command
Answer: b
Feedback:
a. Incorrect. The MySQLi code library is used to retrieve a row from a table and create an associative
array with it.
b. Correct. The include statement creates a link between the contents of the included file and the
file that contains it and makes the contents of the included file available to the code using the
include statement.
c. Incorrect. The text of the included file is not imported, but the code in the included file is made
available to the file where it is included.
d. Incorrect. The functions stay in the original file, but the include statement makes those
functions available in the file where the include statement is used.
4. How can you bypass client-side validation to test a web form for SQL injection resistance? (12.2)
a. You can’t—client-side validation is too robust to bypass in modern browsers.
b. Use the mobile emulator built into the browser.
c. Use the web developer tools to create a POST event.
d. Use PHP code to bypass the web browser.
Answer: c
Feedback:
a. Incorrect. The HTML5 form validation built into all browsers is a good start for client-side
validation, but it can be bypassed by using the web developer tools.
b. Incorrect. The mobile emulator will not bypass the client-side validation.
c. Correct. The web developer tools are built to create individual tests for the steps in deploying a
webpage, so they can also be used to bypass the client-side validation.
d. Incorrect. The PHP code runs at the server, so it can’t be used to bypass the client-side validation
as part of testing for SQL injection resistance.
2