Which function is used to erase all session variables stored in the current session?
A. session_destroy()
B. session_change()
C. session_remove()
D. session_unset()
Select an option to see the answer and solution.
What will the function session_id() return is no parameter is passed?
A. Current Session Identification Number
B. Previous Session Identification Number
C. Last Session Identification Number
D. Error
Select an option to see the answer and solution.
Which one of the following statements should you use to set the session username to Nachi?
A. $SESSION[‘username’] = “Nachi”;
B. $_SESSION[‘username’] = “Nachi”;
C. session_start(“nachi”);
D. $SESSION_START[“username”] = “Nachi”;
Select an option to see the answer and solution.
What will be the output of the following PHP code? Say your previous session username was nachi.
<?php
unset ($_SESSION ['username' ]);
printf ("Username now set to: %s" , $_SESSION ['username' ]);
?> A. Username now set to: nachi
B. Username now set to: System
C. Username now set to:
D. Error
Select an option to see the answer and solution.
An attacker somehow obtains an unsuspecting user’s SID and then using it to impersonate the user inorder to gain potentially sensitive information. This attack is known as.
A. session-fixation
B. session-fixing
C. session-hijack
D. session-copy
Select an option to see the answer and solution.
Which parameter determines whether the old session file will also be deleted when the session ID is regenerated?
A. delete_old_file
B. delete_old_session
C. delete_old_session_file
D. delete_session_file
Select an option to see the answer and solution.
Which function effectively deletes all sessions that have expired?
A. session_delete()
B. session_destroy()
C. session_garbage_collect()
D. session_expired_delete()
Select an option to see the answer and solution.
Which function is used to transform PHP’s session-handler behavior into that defined by your custom handler?
A. session_set_save()
B. session_set_save_handler()
C. Session_handler()
D. session_save_handler()
Select an option to see the answer and solution.
The session_start() function must appear.
A. after the html tag
B. after the body tag
C. before the body tag
D. before the html tag
Select an option to see the answer and solution.
What is the return type of session_set_save_handler() function?
A. boolean
B. integer
C. float
D. character
Select an option to see the answer and solution.
Before you can start processing images with PHP, you must first add the ability to upload images to your administrative form on ________
A. .htaccess
B. function.inc.php
C. index.php
D. admin.php
Select an option to see the answer and solution.
When you’re uploading files you need to set the enctype of the form to __________
A. text
B. text/file
C. multipart/form-data
D. multimedia/form-data
Select an option to see the answer and solution.
To check whether a file was uploaded, you look in the _______ superglobal array.
A. $_FILES
B. $_DOCS
C. $_DOCUMENTS
D. $_FOLDERS
Select an option to see the answer and solution.
To make the ImageHandler class portable you should create a separate file for it called __________
A. imagehandler.inc.php
B. images.inc.php
C. handler.inc.php
D. imghandler.inc.php
Select an option to see the answer and solution.
DocBlocks are indicated by opening a comment using _________
Select an option to see the answer and solution.
To process the file, you need to break the array from $_FILES into individual values. You can do this using the ________ function.
A. divide()
B. list()
C. break()
D. indi()
Select an option to see the answer and solution.
Before you try to process the file, you need to make sure that your $err value is equivalent to _________
A. UPLOAD_ERR_OK
B. UPLOAD_NO_ERR
C. UPLOAD_ERR_NO_OK
D. UPLOAD_ERR
Select an option to see the answer and solution.
You use the $_SERVER superglobal and your _______ property to create your path to check.
A. $load_dir
B. $load
C. $save
D. $save_dir
Select an option to see the answer and solution.
Which function do you have to use to check whether the $path you’ve stored exists?
A. path_dir()
B. path()
C. is_dir()
D. None of the above
Select an option to see the answer and solution.
Which one of the following is true about the following line – $obj = new ImageHandler(‘/images/’, array(400, 300));
A. This snippet sets the maximum dimensions allowed to 400 pixels wide by 300 pixels high
B. This snippet sets the minimum dimensions allowed to 300 pixels wide by 400 pixels high
C. This snippet sets the minimum dimensions allowed to 400 pixels wide by 300 pixels high
D. This snippet sets the maximum dimensions allowed to 300 pixels wide by 400 pixels high
Select an option to see the answer and solution.