Quiz 4: Handling User Input
Computing
Free
True False
False
Q 2Q 2
You must use the global keyword to reference a global variable within the scope of a function.
Free
True False
True
Q 3Q 3
When using the variable name as an index for the $GLOBALS array, you omit the leading dollar sign from the name.
Free
True False
True
Free
True False
Free
True False
Q 6Q 6
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.
Free
True False
Q 7Q 7
When a form's submit button is pressed, each field on the form is sent to the Web server as a name/value pair.
Free
True False
Q 8Q 8
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.
Free
True False
Q 9Q 9
When using the get method to submit form data, the form data is separated from the URL by a colon. (:).
Free
True False
Free
True False
Q 11Q 11
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.
Free
True False
Q 12Q 12
By default, magic_quotes_gpc is the only magic quote directive enabled in the php.ini configuration file.
Free
True False
Free
True False
Free
True False
Q 15Q 15
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
Free
True False
Q 16Q 16
The round() function can be used to ensure that numbers have the appropriate number of digits after the decimal point, if any.
Free
True False
Q 17Q 17
Regular expression functions are some of the best tools for verifying string data meets the strict formatting required for email addresses.
Free
True False
Q 18Q 18
A good programming practice is to stop processing a form when an error is found and display the error to the user.
Free
True False
Q 19Q 19
A sticky form is redisplayed with the values that the user entered the last time the form was submitted.
Free
True False
Q 20Q 20
With complex escaping from XHTML, you close one PHP block, insert some XHTML elements, and then open another PHP block to continue the script.
Free
True False
Free
True False
Q 22Q 22
The subject argument of the mail function must be plain text without XHTML tags or character entities.
Free
True False
Free
True False
Q 24Q 24
The mail() function returns a value of TRUE if the message was sent successfully and FALSE if it was not.
Free
True False
Q 25Q 25
In an all-in-one form, when the user clicks the submit button, the script submits the form to a separate processing script.
Free
True False
Q 26Q 26
The issent() function can be used to determine if the $Submit variable has been set (if the Submit button has been pressed).
Free
True False
Free
True False
Free
True False
Q 29Q 29
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.
Free
True False
Free
True False
Q 31Q 31
Autoglobals or superglobals are predefined ____.
A) variables
B) constants
C) arrays
D) functions
Free
Multiple Choice
Q 32Q 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
Free
Multiple Choice
Q 33Q 33
The $_ENV autoglobal contains ____ variables that programs use to interact with the system.
A) system
B) environmental
C) program
D) script
Free
Multiple Choice
Q 34Q 34
The ____ function displays the elements of the $_ENV array and their values.
A) env_info()
B) systeminfo()
C) phpinfo()
D) php_info()
Free
Multiple Choice
Q 35Q 35
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
Free
Multiple Choice
Q 36Q 36
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
Free
Multiple Choice
Q 37Q 37
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
Free
Multiple Choice
Q 38Q 38
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
Free
Multiple Choice
Q 39Q 39
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
Free
Multiple Choice
Q 40Q 40
The ____ function is used to reverse the changes made by magic quotes or the addslashes() function.
A) removeslashes()
B) stripslashes()
C) deleteslashes()
D) addslashes()
Free
Multiple Choice
Q 41Q 41
The ____ function can be used to determine if a variable contains values.
A) empty()
B) blank()
C) is_null()
D) null
Free
Multiple Choice
Q 42Q 42
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()
Free
Multiple Choice
Q 43Q 43
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
Free
Multiple Choice
Q 44Q 44
In PHP, a(n) e-mail message is sent using the ____ function.
A) email()
B) e-mail()
C) mail()
D) message()
Free
Multiple Choice
Q 45Q 45
Which of the following is NOT a required argument of the mail() function?
A) recipient(s)
B) subject
C) from
D) message
Free
Multiple Choice
Q 46Q 46
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
Free
Multiple Choice
Q 47Q 47
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
Free
Multiple Choice
Q 48Q 48
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
Free
Multiple Choice
Q 49Q 49
A Web page ____ is a single Web page that is divided into sections
A) form
B) template
C) guide
D) fill-in form
Free
Multiple Choice
Q 50Q 50
PHP scripts that are included in a Web template often begin with a prefix of ____.
A) tem
B) dyn
C) pre
D) inc
Free
Multiple Choice
Q 51Q 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
Free
Multiple Choice
Q 52Q 52
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']
Free
Multiple Choice
Q 53Q 53
When using form image buttons, each button requires a unique ____ for the name attribute..
A) title
B) name
C) value
D) id
Free
Multiple Choice
Q 54Q 54
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
Free
Multiple Choice
Q 55Q 55
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
Free
Multiple Choice
Q 56Q 56
____________________ or superglobals are predefined global arrays that contain client, server, and environment information that you can use in your scripts.
Free
Short Answer
Free
Short Answer
Q 58Q 58
You can use the ____________________ autoglobal to include the full URL path and script name of the current script.
Free
Short Answer
Q 59Q 59
To refer to an element in an associative array, you place the element's ____________________ in single or double quotation marks inside the array brackets.
Free
Short Answer
Q 60Q 60
The ____________________ autoglobal contains information about the Web server and the PHP scripting engine, as well as detailed information about the current Web page request.
Free
Short Answer
Free
Short Answer
Q 62Q 62
When the form data is submitted using the ____________________ method, the form data is embedded in a request message.
Free
Short Answer
Q 63Q 63
When you click a form's submit button, each field on the form is sent to the Web server as a ____________________ pair.
Free
Short Answer
Q 64Q 64
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.
Free
Short Answer
Free
Short Answer
Q 66Q 66
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.
Free
Short Answer
Q 67Q 67
A ____________________ is a program or script that processes the information submitted from a Web form.
Free
Short Answer
Q 68Q 68
The ____________________ function can be used to escape user submitted text string when magic quotes is not enabled.
Free
Short Answer
Free
Short Answer
Q 70Q 70
The ____________________ family of functions can be used to ensure that the user enters numeric values where necessary.
Free
Short Answer
Q 71Q 71
Leading or trailing white space can be removed from submitted data using the ____________________ function.
Free
Short Answer
Q 72Q 72
______________________________ refers to opening and closing PHP script sections within an XHTML document.
Free
Essay
Free
Short Answer
Free
Short Answer
Q 75Q 75
A(n) ____________________ form uses a single script to display the Web form and process its data.
Free
Short Answer
Free
Short Answer
Q 77Q 77
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.
Free
Short Answer
Q 78Q 78
When using form image buttons, the ____________________ coordinates are sent in the form "Button.x" and "Button.y".
Free
Short Answer
Q 79Q 79
When using form image buttons in PHP, the periods are replaced by ____________________ for the $_GET and $_POST arrays.
Free
Short Answer
Q 80Q 80
The ____________________ autoglobal can be used to access the result from form data sent with either the get or post methods.
Free
Short Answer
Q 81Q 81
The $_REQUEST autoglobal is not secure because it also includes the contents of the ____________________ autoglobal.
Free
Short Answer
Q 82Q 82
Web page templates can use the ____________________ function within a conditional or switch statement to display dynamic content from different include files within the same section of the template.
Free
Short Answer
Q 83Q 83
If you use the same value for the ____________________ attribute for both buttons and hyperlinks, the same code can be used to process both.
Free
Short Answer