WEB 182 PHP Final Exam

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Which date string matches the pattern that follows?/^[01]?\d\/[0-3]\d\/\d{4}$/

"02/34/1968"

Which character is used to signify the end of the string in a PHP regular expression?

$

To perform a redirect, you can begin by using the ________________ array to check if the current request is using a secure connection.

$_SERVER

Which of the following will match a new line in a PHP regular expression?

/n

Sites that process payments or collect sensitive personal information should use at least ________________-bit SSL.

128

Which SSL strength is supported by most browsers but relatively easy to break?

40-bit

If a match is found in a global search for a regular expression, the function returns

A count of the number of matches and an array that contains all of the matches

Which of the following is NOT a SQL privilege for working with data?

ALTER

Which SQL statement can be used to modify the columns of an existing table?

ALTER TABLE

If a match is found when the preg_split() function is executed, it returns

An array of the substrings that are created by removing the matches

Which of the following diagrams best represents the relationship between a table of customers and a table of orders placed by customers?

Customers Orders CustomerID----------OrderID CustomerName CustomerID OrderDate

Which of the following is NOT a SQL privilege for modifying the structure of a database?

DELETE

Which SQL statement can be used to delete a table?

DROP TABLE

In a SQL statement, the________________ clause specifies the table or tables to retrieve data from

FROM

________________ provides a way to create a new class based on an existing class

Inheritance

Which of the following methods of using PHP to connect to a MySQL database only provides an object-oriented interface?

PDO MySQL driver extension

To send emails, an email server uses ________________.

Simple Message Transfer Protocol (SMTP)

________________ refinement refers to the process of making step-by-step improvements to the protoype for a website with review and evaluation after each step.

Stepwise

Assuming that all of the table and column names are spelled correctly, what's wrong with the INSERT statement that follows? INSERT INTO invoices (vendorID, invoiceNumber, invoiceTotal, paymentTotal, creditTotal, termsID, invoiceDate, invoiceDueDate) VALUES (97, '456789', 8344.50, 0, 0, 1, '2017-08-29')

The number of items in the column list doesn't match the number in the VALUES list.

Which of the statements below best describes the result set returned by this SELECT statement? SELECT vendorState, COUNT(*) AS column2 FROM vendors GROUP BY vendorState HAVING COUNT(*) > 1

The number of vendors in each state that has more than one vendor

Which SQL statement will select a database?

USE

Which of the following will match any character that is NOT a letter, number, or underscore in a PHP regular expression?

\W

Which character is used to signify the beginning or the end of a word in a PHP regular expression?

\b

Which of the following will match any digit in a PHP regular expression?

\d

When you use PHP to format the data that's entered into a content management system, you

add HTML tags to the data wherever necessary

Which of the following is NOT a comparison operator in a SQL statement?

all of the above

Which of the following is a mode used when opening a file with the fopen() function in PHP?

all of these

Which of the following is a property of the mysqli class that can be used for checking the result of a query?

all of these

To create a browser control for uploading a file, you code

an HTML input tag with the type attribute equal to "file"

The view directory for a website is normally used to store the view files that are used by more than one ________________.

application

Regular expressions

can be used to completely validate some types of user entries

Which of the following is a special method executed when a new object is created from a class?

constructor

Include files may include all but one of the types of files that follow. Which one is it?

controller

In a website that uses the MVC pattern, it's common to store the files for each application within the site in a single ________________.

directory

The controller and view files for each application of a website should be stored in a separate ________________.

directory

A subclass can ____________ the superclass by adding new properties and methods.

extend

Which of the these is a PHP function that reads a line from a specified file?

fgets()

Which of the these is a PHP function that gets information about an image?

getimagesize()

A(n) ________________ provides a way for a database management system to locate information more quickly.

index

The controller file for each application of a website is commonly named ________________.

index.php

To save a file that you've uploaded to a permanent location, you can use this PHP function:

move_uploaded_file()

In the object-oriented interface for mysqli, you can use the query() method to run a SELECT statement. In the procedural interface, you use this function:

mysqli_query()

Code example 18-1 SELECT vendorName, COUNT(*) AS numberOfInvoices, MAX(invoiceTotal - paymentTotal - creditTotal) AS balanceBueFROM vendors v JOIN invoices i ON v.vendorID = i.vendorID WHERE invoiceTotal - paymentTotal - creditTotal > (SELECT AVG(invoiceTotal - paymentTotal - creditTotal) FROM invoices) GROUP BY vendorName ORDER BY balanceBue DESC (Please refer to code example 18-1.) When this query is executed, the result set will contain

one row for each vendor that shows the largest balance due for any of the vendor's invoices, but only if that balance due is larger than the average balance due for all invoices

When a new class extends a superclass, it inherits the properties and methods of the superclass. Then, it can

override the inherited methods

The include ________________ for a PHP application tells PHP where to look for the files specified by the include() and require() functions.

path

Which function searches for a regular expression in a string and returns 1 if the pattern is found?

preg_match()

A/an ________________ is a working model of a website that lets the intended users review and evaluate it.

prototype

Before a server uses SSL to transmit data to a client, it

provides a digital secure certificate to the client

To code a method within a class that sets the value for a private property named $name based on the argument that's passed to it, you start with this code:

public function setName($value) {

Which of the following ensures that relationships between tables are maintained correctly?

referential integrity

An email ________________ sends and receives email on behalf of the user.

server

To set the include path for a website, you can use the

set_include_path() function

When you use form-based authentication, you can include two files at the top of each protected page. The first gets a secure connection, and the second

tests whether the $_SESSION array indicates that the user has been validated

It is usually not a good practice to create an index for a column when

the column is frequently updated

When INSERT, UPDATE, or DELETE statements are used in conjunction with a PHP Data Object, what is returned?

the number of rows that were affected

When you send an email with PHPMailer, you set the address that the email is being sent from using

the setFrom() method

When you send an email with PHPMailer, you set the address that the email is being sent to using

the setTo() method

When you identify the data elements in a new database, you typically subdivide data elements into

the smallest practical components

When you use the exception error mode with PDO objects, you can

use try/catch statements to handle the exceptions that occur

One benefit of using a helper file that includes a function for sending an email is that

you can change the code in the file without affecting the rest of the application


Set pelajaran terkait

Psychology Chapter 7 Human Memory

View Set

Object Oriented Programming (with Java)

View Set

Філософія Рівень 3

View Set