Chapter 5

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Which of the following consists of the PHP files that represent the data of the applications? a. model b. requester c. inheriter d. controller

a. model

When you ________________ a request, all processing takes place on the server. a. forward b. demand c. initiate d. Cancel

a. Forward

function get_product($product_id) { global $db; $query = 'SELECT * FROM products WHERE productID = :product_id'; $statement = $db->prepare($query); $statement->bindValue(':product_id', $product_id); $statement->execute(); $product = $statement->fetch(); $statement->closeCursor(); return $product; } (Refer to code example 5-1) Which of the following is a proper PHP statement for calling the function in this example. a. $product = $get_product(product_id); b. $product = get_product($product_id); c. $product = $get_product($product_id); d. $product = get_product(product_id);

b. $product = get_product($product_id);

To make a variable that is declared outside of a function usable inside the PHP function, which keyword can be used? a. public b. global c. local d. module

b. global

Which of the following consists of the PHP and HTML files that represent the user interface of an application? a. logic b. view c. model d. classes

b. view

Which function can be used to redirect a request to another URL? a. require() b. response() c. header() d. include()

c. header()

Which function can be used to forward a request from one PHP file to another? a. return() b. response() c. include() d. location()

c. include()

One reason for using the header() function to redirect a request a. is that it's more efficient than forwarding a request b. is to reduce the number of round trips that are required c. is to have a PHP file run itself again d. is to do all processing for the request on the server

c. is to have a PHP file run itself again

When creating a function, ________________ can be included in the parentheses that follow the name. a. controllers b. formatters c. properties d. parameters

d. parameters

Which type of statement should be included if the function should send a value back to where the function was called? a. send b. parameter c. argument d. return

d. return


Ensembles d'études connexes

Basic Human Nutrition Exam 2 Study Guide

View Set

Social Studies - South American Revolutions

View Set

Independent versus Dependent Variable Practice

View Set

International Business Chapter 8

View Set

Intro to webpage creation final exam

View Set

A+ 220-1101 Exam Acronyms Quiz - Part 1

View Set

Psych of Personality Final- Unit 11

View Set

高職龍騰英文 B1 (B版) L5 Three Strange Guests 單字&片語

View Set