Int Web Prog Ch7
Assume that the second radio button in the code below has been selected by the user. When you get the value of that radio button, what will the value be? <input type="radio" name="delivery" value="USPS">USPS <input type="radio" name="delivery" value="FedEx">Federal Express <input type="radio" name="delivery" value="UPS">UPS
FedEx
A/an ________________ is similar to a text field, but it can display multiple lines of text.
text area
If a form uses the ________________ method, the data for the fields is displayed in the URL.
GET
Which method of the form appends values to the URL to pass data?
GET
The echo and ________________ statements are similar, but the echo statement can accept multiple parameters.
Which type of input element should be used on a form when the user can select only one of the options?
radio
How many radio buttons from the following code can be selected at any given time? <input type="radio" name="address" value="Home">Home Address <input type="radio" name="delivery" value="FedEx">Federal Express <input type="radio" name="delivery" value="UPS">UPS
2
The nl2br() function can be used to convert new line entries in a text area into HTML ________________ tags.
<br>
HTML ________________ tags are used to define the text boxes, password boxes, radio buttons, and check boxes on a form.
<input>
Typically, you would use the ________________ method if a form contains password fields or other sensitive data that you don't want to display in the URL.
POST
Which HTML element is used to create items in a drop-down list?
option
Which HTML element is used to create a drop-down list?
select
Assume that the POST method is used. Which of the following statements gets the value of the radio button that's on in the delivery group and stores it in a variable named $card_type? <input type="radio" name="delivery" value="USPS">USPS <input type="radio" name="delivery" value="FedEx">Federal Express <input type="radio" name="delivery" value="UPS">UPS
$card_type = filter_input(INPUT_POST, 'delivery');
Which character is used to separate parameters that are appended to a URL?
&
Which character is used to separate the original URL from the parameters that are appended to it?
?
Assume that the statements that follow get the data from a text area named comments. After these statements are executed, how will the $comments_esc variable be displayed by an echo statement? $comments = filter_input(INPUT_POST, 'comments'); $comments_esc = htmlspecialchars($comments);
With character entities for special characters
An HTML ________________ lets you display some special characters on a web page.
character entity
Which type of input element should be used on a form when the user can select zero, one, or many of the options in a group?
checkbox
When you use the htmlspecialchars() and nl2br() functions to process a user's entry and then pass that entry to a web page, the browser will
display any HTML tags entered by the user instead of processing them
A hidden field
doesn't appear on the form but its data is sent to the server
In a/an ________________ list, only one option can be selected.
drop-down
The htmlspecialchars() function can be used to convert some of the special characters that a user has entered into a text box or text area into HTML character ________________. This provides a way to display special characters and helps to guard against XSS attacks.
entities
Which PHP function converts some special characters into character entities?
htmlspecialchars()
To test whether a check box has been checked, you can use the ________________ function.
isset()
Which PHP function can be used to determine if a checkbox is checked?
isset()
Which attribute of a form element determines how the data is passed to a file?
method
Which optional attribute of a select element allows the user to select more than one option in a list box?
multiple
In order to group multiple radio buttons so that only one of the radio buttons can be selected at a time, which attribute of the input element must have the same value for all radio buttons in the group?
name
