cookie
When a browser requests an image identified by an img tag, it never sends a Cookie header.
A. TRUE
B. FALSE |
cookie
How can you determine whether a PHP script has already sent cookies to the client?
A. Use $_COOKIE
B. Use the getcookie() function
C. Use the headers_sent() function
D. Use JavaScript to send a second HTTP request |
Filtering
Which of the following filtering techniques prevents all cross-site scripting (XSS)
vulnerabilities?
A. Strip all occurrences of the string <script .
B. Strip all occurrences of the string javascript .
C. Enable magic_quotes_gpc .
D. None of the above. |
ERRORS
How should you track errors on your production website?
A. Enabling display_errors
B. Enabling log_errors
C. Having a site-wide exception handler
D. Setting error_reporting to E_ALL & ~E_NOTICE |
tmp_name
What is the name of the key for the element in $_FILES['name'] that contains the provisional name of the uploaded file? |
SPL
Which SPL class implements fixed-size storage? |
Answer : SplFixedArray
uploads
Which of the following is NOT a requirement for file uploads to work?
A. The PHP directive file_uploads must be set to On
B. The form's method attribute must be set to "post"
C. The form must include a hidden input element with the name set to "MAX_FILE_SIZE"
D. The form's enctype attribute must be set to "multipart/form-data" |
type of uploaded
What information can be used to reliably determine the type of an uploaded file?
A. MIME type
B. File name extension
C. Contents of the file |
static binding
Late static binding is used in PHP to:
A. Load dynamic libraries and extensions at runtime
B. Use caller class information provided in a static method call
C. Resolve undefined class names by automatically including needed files
D. Find the proper method to call according to the call arguments |
Transactions
Transactions are used to...
A. guarantee high performance
B. secure data consistency
C. secure access to the database
D. reduce the database server overhead
E. reduce code size in PHP |
SOAPServer
Which of the following can be registered as entry points with a SoapServer instance (choose 2):
A. A single function
B. A single method from a class
C. All methods from a class
D. All classes defined in a script |
Security
One common security risk is exposing error messages directly in the browser. Which PHP configuration directive can be disabled to prevent this?
A. html_display
B. error_reporting
C. display_errors
D. error_log
E. ignore_repeated_errors |
SOAPServer
Which of the following statements about SOAP is NOT true?
A. SOAP is also a request-/response-based protocol.
B. SOAP can be transported using SMTP, HTTP and other protocols.
C. SOAP requires developers to use WSDL.
D. SOAP traffic via HTTP can be encrypted and compressed just like other HTTP requests. |
SOAPServer
Which of the following statements about SOAP is NOT true?
A. SOAP is also a request-/response-based protocol.
B. SOAP can be transported using SMTP, HTTP and other protocols.
C. SOAP requires developers to use WSDL.
D. SOAP traffic via HTTP can be encrypted and compressed just like other HTTP requests. |
SOAPServer
Which of the following statements about SOAP is NOT true?
A. SOAP is also a request-/response-based protocol.
B. SOAP can be transported using SMTP, HTTP and other protocols.
C. SOAP requires developers to use WSDL.
D. SOAP traffic via HTTP can be encrypted and compressed just like other HTTP requests. |
|
|
Sessions
When tracking upload progress with sessions, the values of 2 INI settings are needed to determine the key in $_SESSION of the upload progress data. What are the INI settings?
A. session.upload_progress.file
B. session.upload_progress.key
C. session.upload_progress.prefix
D.session.upload_progress.freq
E. session.upload_progress.name |
opcode cache
What will an opcode cache ALWAYS automatically improve?
A. Running time of a loop in a PHP script
B. Efficiency of HTML markup generated by a PHP script
C. Execution speed of a PHP script
D. Memory footprint of a PHP script
E. None of the above |
opcode cache
What will an opcode cache ALWAYS automatically improve?
A. Running time of a loop in a PHP script
B. Efficiency of HTML markup generated by a PHP script
C. Execution speed of a PHP script
D. Memory footprint of a PHP script
E. None of the above |
cashe
What is cached by an opcode cache?
A. Compiled PHP code
B. Native PHP extensions
C. Data sent to the client
D. Data received from the database |
interface
Which of the following statements is correct?
A. Interfaces can extend only one interface
B. Interfaces can extend more than one interface
C. Interfaces can inherit a method from different interfaces
D. Interfaces can redeclare inherited methods |
status code
Which class of HTTP status codes is used for redirections?
A. 2XX
B. 3XX
C. 4XX
D. 5XX |
Mime type
Which MIME type is always sent by a client if a JPEG file is uploaded via HTTP?
A. image/jpeg
B. image/jpg
C. image/pjpeg
D. Depends on the client system |
Security
Which class of HTTP status codes is used for server error conditions?
A. 2XX
B. 3XX
C. 4XX
D. 5XX |
Security
Your public web application needs to provide access to binary files for registered users only. How would you achieve this?
A. Host the files on a public external file sharing service.
B. Redirect to the file which resides in the server's document root
C. Use PHP to send the file to the client, using the header() function to set appropriate HTTP headers
D. PHP is used for service HTML content, not binary content |
Security
In a shared hosting environment, session data can be read by PHP scripts written by any user. How can you prevent this? (Choose 2)
A. Store session data in a different location with session.save_path .
B. Store session data in a database.
C. Enable safe_mode .
D. Set session.name to something unique. |
Security
Which of the following are NOT acceptable ways to create a secure password hash in PHP? (Choose 2)
A. md5()
B. hash_pbkdf2()
C. password_hash()
D. crypt()
E. openssl_digest() |
|
|
Security
Is the following code vulnerable to SQL injection ($msqli is an instance of the MySqli class)?
$age= $mysqli->real_escape_string($_GET['age']);
$name = $mysqli->real_escape_string($_GET['name'];
$query = "SELECT * FROM 'table' WHERE name LIKE '$name' AND age = $age" ;
$results= $mysqli-> query($query);
A.No, the code is fully protected from SQL injection
B. Yes, Because the $name variable is improperly escaped
C. Yes, because the $name variable and the $age variable is improperly escaped
D. Yes, because the $age variable is improperly escaped
E. Yes , because you cannot prevent SQL injection when using MySqli |
Security
You work for a shared hosting provider, and your supervisor asks you to disable user scripts to dynamically load PHP extensions using the dl() function. How can you do this? (choose 2)
A. Set enable_dl to Off in the servers php.ini configuration file
B. Add dl to the current value of disable_functions in the servers php.ini configuration file
C. Add dl to the current value of disable_classes in the servers php.ini configuration file
D. Write a custom function called dl(), save it under the name prepend,inc and then set the auto_prepend_file directive to prepend.inc in php.ini |
Security
Which of the following can NOT be used to send a cookie from within a PHP application?
A. header()
B. $_COOKIE
C. setcookie()
D. setrawcookie() |
Security
When using password_hash() with the PASSWORD_DEFAULT algorithm constant, which of the following is true? (Choose 2)
A. The algorithm that is used for hashing passwords can change when PHP is upgraded.
B. The salt option should always be set to a longer value to account for future algorithm requirements.
C. The string length of the returned hash can change over time.
D. The hash algorithm that's used will always be compatible with crypt() . |
Security
What types of HTTP authentication are supported by PHP? (Choose 2)
A. Basic
B. Advanced
C. Strict
D. Digest
E. Realm |
Security
What is the name of the header used to require HTTP authentication?
A. Authorization-Required
B. WWW-Authenticate
C. HTTP-Authenticate
D. Authentication-Required
E. HTTP-Auth |
Security
Which of the following does NOT help to protect against session hijacking and fixation attacks?
A. Use SSL and set the $secure cookie parameter to true .
B. Set the session.use_only_cookies php.ini parameter to 1 .
C. Set the session.cookie_lifetime php.ini parameter to 0 .
D. Protect against XSS vulnerabilities in the application.
E. Rotate the session id on successful login and logout using session_regenerate_id() |
Security
What can prevent PHP from being able to open a file on the hard drive (Choose 2)?
A. File system permissions
B. File is outside of open_basedir
C. File is inside the /tmp directory.
D. PHP is running in CGI mode. |
Security
Which options do you have in PHP to set the expiry date of a session?
A. Set the session.duration directive in php.ini
B. Set session cookie expiry date locally via session_set_cookie_params()
C. Set session expiry date locally via session_cache_expire()
D. None of the above |
|