214 quizzes found.

If you would like to change the session ID generation function, which of the following is the best approach for PHP 5?

  1. Set the session.hash_function INI configuration directive
  2. Use the session_set_id_generator() function
  3. Set the session id by force using the session_id() function
  4. Use the session_regenerate_id() function
  5. Implement a custom session handler

Choose 1 answers

Consider the following HTML fragement. Which of the following name attributes should be used to capture all of the data from the user in PHP?

<select name="?????" multiple><option value="1">Item #1</option><!-- ... more options ... --></select>
  1. myselectbox=array()
  2. myselectbox[]
  3. myselectbox['multiple']
  4. myselectbox{'multiple'}
  5. myselectbox

Choose 1 answers

When uploading a file using HTTP, which variable can be used to locate the file on PHP's local filesystem?

  1. None of the above
  2. $_FILES['fieldname']['tmp_name']
  3. $_FILES['fieldname']
  4. $_FILES['fieldname'][0]['filename']
  5. $_FILES['fieldname']['filename']

Choose 1 answers

To force a user to redirect to a new URL from within a PHP 5 script, which of the following should be used?

  1. Send a HTTP "Location:" header
  2. Use the HTML <redirect> Tag
  3. Send a HTTP "Forward:" header
  4. Use the redirect() function

Choose 1 answers

Setting a cookie on the client in PHP 5 can be best accomplished by:

  1. Use the add_cookie() function
  2. Use the setcookie() function
  3. Use the the apache_send_header() function
  4. Setting a variable in the $_COOKIE superglobal

Choose 1 answers