Deck 4: Handling User Input
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/83
Play
Full screen (f)
Deck 4: Handling User Input
1
PHP includes a feature called magic quotes, which automatically adds a backslash (\) to any single quote, double quote, or NULL character in submitted form data.
True
2
The get method restricts the number of characters that can be appended to a URL to 255.
False
3
The value of the method attribute will be either post or get.
True
4
When the form data is submitted using the get method, the form data is appended to the URL specified in the form's method attribute.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
5
The round() function can be used to ensure that numbers have the appropriate number of digits after the decimal point, if any.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
6
With complex escaping from XHTML, you close one PHP block, insert some XHTML elements, and then open another PHP block to continue the script.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
7
The best way to ensure valid form data is to build the Web form with controls that only allow the user to enter acceptable responses
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
8
The method attribute defines how the form data is submitted to the server.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
9
When the post method is used to submit a form, the name portion of the name/value pair becomes the value assigned to the array element.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
10
When using the get method to submit form data, the form data is separated from the URL by a colon. (:).
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
11
When a form's submit button is pressed, each field on the form is sent to the Web server as a name/value pair.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
12
Regular expression functions are some of the best tools for verifying string data meets the strict formatting required for email addresses.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
13
You must use the global keyword to reference a global variable within the scope of a function.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
14
A sticky form is redisplayed with the values that the user entered the last time the form was submitted.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
15
The alternate method to escape strings is the stripslashes() function.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
16
A good programming practice is to stop processing a form when an error is found and display the error to the user.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
17
Autoglobal array elements are referred to with an index number.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
18
By default, magic_quotes_gpc is the only magic quote directive enabled in the php.ini configuration file.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
19
When using the variable name as an index for the $GLOBALS array, you omit the leading dollar sign from the name.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
20
The blank() function can be used to determine if a value was entered in a form.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
21
The mail() function returns a value of TRUE if the message was sent successfully and FALSE if it was not.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
22
When you use the ____ method to submit form data to the processing script, the form data is appended to the URL specified by the action attribute.
A) get
B) post
C) request
D) submit
A) get
B) post
C) request
D) submit
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
23
The post method is ideal for embedding options in a hyperlink.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
24
The subject argument of the mail function must be plain text without XHTML tags or character entities.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
25
The PHP feature that automatically adds a backslash to any single quote, double quote, or NULL character contained in form data that a user submits to a PHP script is ____.
A) base quotes
B) special quotes
C) magic quotes
D) special quotes
A) base quotes
B) special quotes
C) magic quotes
D) special quotes
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
26
The ____ function is used to reverse the changes made by magic quotes or the addslashes() function.
A) removeslashes()
B) stripslashes()
C) deleteslashes()
D) addslashes()
A) removeslashes()
B) stripslashes()
C) deleteslashes()
D) addslashes()
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
27
The value of the ____ attribute identifies the program on the Web server that will process the form data when the form is submitted.
A) action
B) method
C) name
D) id
A) action
B) method
C) name
D) id
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
28
In PHP, an e-mail message is sent using the email() function.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
29
The $_ENV autoglobal contains ____ variables that programs use to interact with the system.
A) system
B) environmental
C) program
D) script
A) system
B) environmental
C) program
D) script
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
30
In an all-in-one form, when the user clicks the submit button, the script submits the form to a separate processing script.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
31
You cannot use buttons to target content to a dynamic section of a Web page template.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
32
Autoglobals are associative arrays whose elements are referred to with a(n) ____ key instead of an index number.
A) numeric
B) alphanumeric
C) symbolic
D) alphabetic
A) numeric
B) alphanumeric
C) symbolic
D) alphabetic
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
33
When using text hyperlinks to navigate within a Web page template, the values that specify which dynamic content to show must be appended to the filename in the "href" attribute of the anchor tag.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
34
When you click a form's submit button, each field on the form is sent to the Web server as a ____ pair.
A) true/false
B) name/value
C) variable/value
D) yes/no
A) true/false
B) name/value
C) variable/value
D) yes/no
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
35
The issent() function can be used to determine if the $Submit variable has been set (if the Submit button has been pressed).
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
36
The unset() function is used to uninitialize a variable after it has been set.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
37
Autoglobals or superglobals are predefined ____.
A) variables
B) constants
C) arrays
D) functions
A) variables
B) constants
C) arrays
D) functions
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
38
From, Cc, Bcc and Date headers are examples of additional headers.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
39
You can use ____ autoglobal array to refer to the global version of a variable from inside a function.
A) $GLOBALS
B) $_GLOBAL
C) $_GLOBALS
D) $GLOBAL
A) $GLOBALS
B) $_GLOBAL
C) $_GLOBALS
D) $GLOBAL
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
40
The ____ function displays the elements of the $_ENV array and their values.
A) env_info()
B) systeminfo()
C) phpinfo()
D) php_info()
A) env_info()
B) systeminfo()
C) phpinfo()
D) php_info()
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
41
The ____ autoglobal can be used to access the result from form data sent with both the get and post methods.
A) $_FILES
B) $_FORMS
C) $_REQUEST
D) $_SUBMIT
A) $_FILES
B) $_FORMS
C) $_REQUEST
D) $_SUBMIT
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
42
A ____ form contains one page that displays the Web form and one page that process the form data.
A) two-part
B) binary
C) double
D) dual
A) two-part
B) binary
C) double
D) dual
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
43
There are security risks using the $_REQUEST autoglobal because it includes the contents of the ____ autoglobal as well as the $_GET and $_POST autoglobals.
A) $_COOKIES
B) $_ENV
C) $_FILES
D) $_COOKIE
A) $_COOKIES
B) $_ENV
C) $_FILES
D) $_COOKIE
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
44
The script in the dynamic data section of the Web page template will check the value of the ____ array to determine which page to display, assuming the name being passed is 'page'.
A) $_GET['page']
B) $_POST['page']
C) $_PAGE['page']
D) $SUBMIT['page']
A) $_GET['page']
B) $_POST['page']
C) $_PAGE['page']
D) $SUBMIT['page']
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
45
To refer to an element in an associative array, you place the element's ____________________ in single or double quotation marks inside the array brackets.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
46
The ____________________ autoglobal contains information about the Web server and the PHP scripting engine, as well as detailed information about the current Web page request.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
47
PHP scripts that are included in a Web template often begin with a prefix of ____.
A) tem
B) dyn
C) pre
D) inc
A) tem
B) dyn
C) pre
D) inc
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
48
____________________ or superglobals are predefined global arrays that contain client, server, and environment information that you can use in your scripts.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
49
The two simplest forms of the ____ are the plain e-mail address and the recipient's name followed by the e-mail address in angle brackets.
A) Address Form
B) Internet Message Format
C) Address Specifier
D) Message Format
A) Address Form
B) Internet Message Format
C) Address Specifier
D) Message Format
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
50
A Web page ____ is a single Web page that is divided into sections
A) form
B) template
C) guide
D) fill-in form
A) form
B) template
C) guide
D) fill-in form
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
51
If the content of a Web page template section does not change unless the include file is modified, it is called a ____ section.
A) static
B) dynamic
C) include
D) constant
A) static
B) dynamic
C) include
D) constant
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
52
The ____ function can be used to determine if a variable contains values.
A) empty()
B) blank()
C) is_null()
D) null
A) empty()
B) blank()
C) is_null()
D) null
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
53
A form that contains the values that a user previously entered in the form is called a ____ form.
A) pre-populated
B) free form
C) redisplayed
D) sticky
A) pre-populated
B) free form
C) redisplayed
D) sticky
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
54
In PHP, a(n) e-mail message is sent using the ____ function.
A) email()
B) e-mail()
C) mail()
D) message()
A) email()
B) e-mail()
C) mail()
D) message()
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
55
You can use the ____________________ autoglobal to include the full URL path and script name of the current script.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
56
The additional_headers argument needs to be formatted to conform to the syntax of headers in the ____ documentation.
A) Internet Message Format
B) Internet Email Format
C) Internet Mail Format
D) Email Message Format
A) Internet Message Format
B) Internet Email Format
C) Internet Mail Format
D) Email Message Format
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
57
Which of the following is NOT a required argument of the mail() function?
A) recipient(s)
B) subject
C) from
D) message
A) recipient(s)
B) subject
C) from
D) message
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
58
The ____________________ autoglobal contains information about uploaded files.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
59
When using form image buttons, each button requires a unique ____ for the name attribute..
A) title
B) name
C) value
D) id
A) title
B) name
C) value
D) id
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
60
The ____ function can be used to ensure that a number has the appropriate number of decimal places.
A) round()
B) set_decimal()
C) round_dec()
D) decimal_round()
A) round()
B) set_decimal()
C) round_dec()
D) decimal_round()
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
61
Any valid e-mail header may be added to an email using the ____________________ argument
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
62
The ____________________ attribute in the opening
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
63
In PHP, an e-mail message is sent using the ____________________ function.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
64
The ____________________ function can be used to escape user submitted text string when magic quotes is not enabled.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
65
The get method is useful as a ____________________ technique because it allows you to see the names and values that are being sent to the Web server.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
66
A(n) ____________________ form uses a single script to display the Web form and process its data.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
67
Leading or trailing white space can be removed from submitted data using the ____________________ function.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
68
When using text hyperlinks, the values that specify which dynamic content to display need to be appended to the file name in the ____________________ attribute of the anchor tag.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
69
The ____________________ family of functions can be used to ensure that the user enters numeric values where necessary.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
70
______________________________ refers to opening and closing PHP script sections within an XHTML document.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
71
When the form data is submitted using the ____________________ method, the form data is embedded in a request message.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
72
Name/value pairs appended to the URL are called ____________________.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
73
The ____________________ autoglobal can be used to access the result from form data sent with either the get or post methods.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
74
The ____________________ function can be used to determine if a variable contains values.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
75
When using form image buttons, the ____________________ coordinates are sent in the form "Button.x" and "Button.y".
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
76
When using form image buttons in PHP, the periods are replaced by ____________________ for the $_GET and $_POST arrays.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
77
When you click a form's submit button, each field on the form is sent to the Web server as a ____________________ pair.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
78
When you use the get method to submit form data to the processing script, the form data is appended to the ____________________ specified by the action attribute.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
79
A ____________________ may contain both static and dynamic sections on a single page.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck
80
A ____________________ is a program or script that processes the information submitted from a Web form.
Unlock Deck
Unlock for access to all 83 flashcards in this deck.
Unlock Deck
k this deck