Pass the Zend PHP and Zend Framework Certifications 200-550 Questions and answers with CertsForce

Viewing page 4 out of 7 pages
Viewing questions 31-40 out of questions
Questions # 31:

An HTML form contains this form element:

<input type="image" name="myImage" src="image.png" />

The user clicks on the image to submit the form. How can you now access the relative coordinates of the mouse click?

Options:

A.

$_FILES['myImage']['x'] and $_FILES['myImage']['y']


B.

$_POST['myImage']['x'] and $_POST['myImage']['y']


C.

$_POST['myImage.x'] and $_POST['myImage.y']


D.

$_POST['myImage_x'] and $_POST['myImage_y']


Expert Solution
Questions # 32:

What SimpleXML function is used to parse a file?

Options:

A.

simplexml_load_file()


B.

simplexml_load_string()


C.

load()


D.

loadFile()


E.

loadXML()


F.

None of the above.


Expert Solution
Questions # 33:

Which of the following functions will allow identifying unique values inside an array?

Options:

A.

array_unique_values


B.

array_distinct


C.

array_count_values


D.

array_intersect


E.

array_values


Expert Solution
Questions # 34:

What is the output of the following code?

var_dump(boolval(new StdClass()));

Options:

A.

bool(true)


B.

bool(false)


Expert Solution
Questions # 35:

What is the preferred method for preventing SQL injection?

Options:

A.

Always using prepared statements for all SQL queries.


B.

Always using the available database-specific escaping functionality on all variables prior to building the SQL query.


C.

Using addslashes() to escape variables to be used in a query.


D.

Using htmlspecialchars() and the available database-specific escaping functionality to escape variables to be used in a query.


Expert Solution
Questions # 36:

Which of the following statements is true?

Options:

A.

All PHP database extensions support prepared statements


B.

All PHP database extensions come with their own special helper functions to escape user data to be used in dynamic SQL queries


C.

All PHP database extensions provide an OOP interface


D.

All PHP database extensions appear in the output of php -m , if installed and enabled


Expert Solution
Questions # 37:

An unbuffered database query will: (Choose 2)

Options:

A.

Return the first data faster


B.

Return all data faster


C.

Free connection faster for others scripts to use


D.

Use less memory


Expert Solution
Questions # 38:

What is the pattern modifier for handling UTF-8 encoded preg_* functionality?

Options:

A.

e


B.

u


C.

PHP does not support UTF-8 encoded strings


D.

A pattern modifier is not needed


Expert Solution
Questions # 39:

An HTML form contains this form element:

<input type="file" name="myFile" />

When this form is submitted, the following PHP code gets executed:

move_uploaded_file(

$_FILES['myFile']['tmp_name'],

'uploads/' . $_FILES['myFile']['name']

);

Which of the following actions must be taken before this code may go into production? (Choose 2)

Options:

A.

Check with is_uploaded_file() whether the uploaded file $_FILES['myFile']['tmp_name'] is valid


B.

Sanitize the file name in $_FILES['myFile']['name'] because this value is not consistent among web browsers


C.

Check the charset encoding of the HTTP request to see whether it matches the encoding of the uploaded file


D.

Sanitize the file name in $_FILES['myFile']['name'] because this value could be forged


E.

Use $HTTP_POST_FILES instead of $_FILES to maintain upwards compatibility


Expert Solution
Questions # 40:

Consider the following code:

$result = $value1 ??? $value2;

Which operator needs to be used instead of ??? so that $result equals $value1 if $value1 evaluates to true, and equals $value2 otherwise? Just state the operator as it would be required in the code.


Expert Solution
Viewing page 4 out of 7 pages
Viewing questions 31-40 out of questions