MCQGeeks
0 : 0 : 1
CBSE
JEE
NTSE
NEET
English
UK Quiz
Quiz
Driving Test
Practice
Games
Quiz
php
Quiz 2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Q.1
The session_start() function must appear.
after the html tag
after the body tag
before the body tag
before the html tag
Q.2
Which one of the following statements should you use to set the session username to Nachi?
$SESSION[‘username’] = “Nachi”;
$_SESSION[‘username’] = “Nachi”;
session_start(“nachi”);
$SESSION_START[“username”] = “Nachi”;
Q.3
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'
]);
?>
Username now set to: nachi
Username now set to: System
Username now set to:
Error
Q.4
What is the return type of session_set_save_handler() function?
boolean
integer
float
character
Q.5
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.
session-fixation
session-fixing
session-hijack
session-copy
Q.6
If the directive session.cookie_lifetime is set to 3600, the cookie will live until.
3600 sec
3600 min
3600 hrs
the browser is restarted
Q.7
Neglecting to set which of the following cookie will result in the cookie’s domain being set to the host name of the server which generated it.
session.domain
session.path
session.cookie_path
session.cookie_domain
Q.8
What is the default number of seconds that cached session pages are made available before the new pages are created?
360
180
3600
1800
Q.9
What is the default time(in seconds) for which session data is considered valid?
1800
3600
1440
1540
Q.10
Which one of the following function is used to start a session?
start_session()
session_start()
session_begin()
begin_session()
Q.11
Which directive sets a maximum allowable amount of memory in megabytes that a script can allow?
max_size
post_max_size
max_memory_limit
memory_limit
Q.12
If you want to temporarily store uploaded files in the /tmp/phpuploads/ directory, which one of the following statement will you use?
upload_tmp_dir “/tmp/phpuploads/ directory”
upload_dir “/tmp/phpuploads/ directory”
upload_temp_dir “/tmp/phpuploads/ directory”
upload_temp_director “/tmp/phpuploads/ directory”
Q.13
Which superglobal stores a variety of information pertinent to a file uploaded to the server via a PHP script?
$_FILE Array
$_FILEs Array
$_FILES_UPLOADED Array
$_FILE_UPLOADED Array
Q.14
How many items are available in the $_FILES array?
2
3
4
5
Q.15
Which function is used to determine whether a file was uploaded?
is_file_uploaded()
is_uploaded_file()
file_uploaded(“filename”)
uploaded_file(“filename”)
Q.16
Which one of the following is the very first task executed by a session enabled page?
Delete the previous session
Start a new session
Check whether a valid session exists
Handle the session
Q.17
How many ways can a session data be stored?
3
4
5
6
Q.18
Which directive determines how the session information will be stored?
save_data
session.save
session.save_data
session.save_handler
Q.19
Which one of the following is the default PHP session name?
PHPSESSID
PHPSESID
PHPSESSIONID
PHPIDSESS
Q.20
If session.use_cookie is set to 0, this results in use of.
Session
Cookie
URL rewriting
Nothing happens
0 h : 0 m : 1 s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Report Question
×
What's an issue?
Question is wrong
Answer is wrong
Other Reason
Want to elaborate a bit more? (optional)