PHP/PHP Mcq Set 3 Sample Test,Sample questions

Question:
 How many items are available in the $_FILES array?

1.2

2.3

3.4

4.5

Posted Date:-2021-07-17 09:14:12


Question:
AddType application/x-httpd-asp .asp

1.PHP 5.1.0

2.PHP 5.2.0

3.PHP 5.3.0

4.PHP 5.3.1

Posted Date:-2021-07-17 09:14:12


Question:
An attacker somehow obtains an unsuspecting users SID and then using it to impersonate the user in order to gain potentially sensitive information. This attack is known as __________

1.session-fixation

2.session-fixing

3.session-hijack

4.session-copy

Posted Date:-2021-07-17 09:14:12


Question:
How many configuration directives pertinent to PHPs mail function are available?

1.4

2.5

3.6

4.7

Posted Date:-2021-07-17 09:14:12


Question:
How many ways can a session data be stored?

1.3

2.4

3.5

4.6

Posted Date:-2021-07-17 09:14:12


Question:
If session.use_cookie is set to 0, this results in use of _____________

1.Session

2.Cookie

3.URL rewriting

4.Nothing happens

Posted Date:-2021-07-17 09:14:12


Question:
If the directive session.cookie_lifetime is set to 3600, the cookie will live until ____________

1.3600 sec

2.3600 min

3.3600 hrs

4.the browser is restarted

Posted Date:-2021-07-17 09:14:12


Question:
Neglecting to set which of the following cookie will result in the cookies domain being set to the host name of the server which generated it.

1.session.domain

2.session.path

3.session.cookie_path

4.session.cookie_domain

Posted Date:-2021-07-17 09:14:12


Question:
Parameter flags was added in which version of PHP?

1.PHP 4.0

2.PHP 4.1

3.PHP 4.2

4.PHP 4.3

Posted Date:-2021-07-17 09:14:12


Question:
Say I want to change the extension of a PHP file, which of the following statements should I edit to change from .php to .html in the httpd.conf file?

1.AddType application/x-httpd-php .php

2.AddType application/x-httpd-php .asp

3.AddType application/x-httpd-asp .php

4.AddType application/x-httpd-asp .asp

Posted Date:-2021-07-17 09:14:12


Question:
Suppose all web material is located within the directory /home/www. To prevent users from viewing and manipulating files such as /etc/password, which one of the following statements should you use?

1.open_dir = “/home/www/”

2.open_dir = /home/www/

3.open_basedir = /home/www/

4.open_basedir = “/home/www/”

Posted Date:-2021-07-17 09:14:12


Question:
The memory_limit is only applicable if ________ is enabled when you configure PHP.

1.enable-limit

2.-enable-memory-limit

3.enable-memory-limit

4.memory-limit

Posted Date:-2021-07-17 09:14:12


Question:
The session_start() function must appear _________

1.after the html tag

2.after the body tag

3.before the body tag

4.before the html tag

Posted Date:-2021-07-17 09:14:12


Question:
The updated MySQL extension released with PHP 5 is typically referred to as _____

1.MySQL

2.mysql

3.mysqli

4.mysqly

Posted Date:-2021-07-17 09:14:12


Question:
What is the default number of seconds that cached session pages are made available before the new pages are created?

1.360

2.180

3.3600

4.1800

Posted Date:-2021-07-17 09:14:12


Question:
What is the default port number of HTTPs?

1.70

2.80

3.90

4.100

Posted Date:-2021-07-17 09:14:12


Question:
What is the default time(in seconds) for which session data is considered valid?

1.1800

2.3600

3.1440

4.1540

Posted Date:-2021-07-17 09:14:12


Question:
What is the default value of max_execution_time directive? This directive specifies how many seconds a script can execute before being terminated.

1.10

2.20

3.30

4.40

Posted Date:-2021-07-17 09:14:12


Question:
What is the full form of DNS?

1.Digital Network System

2.Domain Network System

3.Digital Name Systmem

4.Domain Name System

Posted Date:-2021-07-17 09:14:12


Question:
What is the return type of session_set_save_handler() function?

1.boolean

2.integer

3.float

4.character

Posted Date:-2021-07-17 09:14:12


Question:
What will be the output if we replace the line $num = preg_grep(“/[0-5]/”, $number); with $num = preg_grep(“/[0-5]/”, $number, PREG_GREP_INVERT);?

1.Array([0]=>0 [1]=>1 [2]=>two [3]=>three [4]=>four [5]=>5)

2.Array([2]=>two [3]=>three [4]=>four)

3.Array([1]=> 1)

4.Array([0]=>0 [5]=>5)

Posted Date:-2021-07-17 09:14:12


Question:
What will the function session_id() return is no parameter is passed?

1.Current Session Identification Number

2.Previous Session Identification Number

3.Last Session Identification Number

4.Error

Posted Date:-2021-07-17 09:14:12


Question:
Which Apache directive outputs Apaches server version, server name, port and compile-in modules?

1.ServerSignature

2.ServerName

3.ServerDetails

4.ServerInfo

Posted Date:-2021-07-17 09:14:12


Question:
Which directive determines how the session information will be stored?

1.save_data

2.session.save

3.session.save_data

4.session.save_handler

Posted Date:-2021-07-17 09:14:12


Question:
Which directive determines which degree of server details is provided if the ServerSignature directive is enabled?

1.ServerAddons

2.ServerExtra

3.ServerTokens

4.ServerDetails

Posted Date:-2021-07-17 09:14:12


Question:
Which directive should we disable to obscure the fact that PHP is being used on our server?

1.show_php

2.expose_php

3.print_php

4.info_php

Posted Date:-2021-07-17 09:14:12


Question:
Which function effectively deletes all sessions that have expired?

1.session_delete()

2.session_destroy()

3.session_garbage_collect()

4.SessionHandler::gc

Posted Date:-2021-07-17 09:14:12


Question:
Which function is used to determine whether a file was uploaded?

1.is_file_uploaded()

2.is_uploaded_file()

3.file_uploaded("filename")

4.uploaded_file("filename")

Posted Date:-2021-07-17 09:14:12


Question:
Which function is used to erase all session variables stored in the current session?

1.session_destroy()

2.session_change()

3.session_remove()

4.session_unset()

Posted Date:-2021-07-17 09:14:12


Question:
Which function is used to transform PHPs session-handler behavior into that defined by your custom handler?

1.session_set_save()

2.session_set_save_handler()

3.Session_handler()

4.session_save_handler()

Posted Date:-2021-07-17 09:14:12


Question:
Which of the following statements is used to add an attachment to the mail?

1.$mimemail->attachment(‘attachment.pdf’);

2.$mimemail=>attachment(‘attachment.pdf’);

3.$mimemail->addAttachment(‘attachment.pdf’);

4.$mimemail=>addAttachment(‘attachment.pdf’);

Posted Date:-2021-07-17 09:14:12


Question:
Which one of the following databases has PHP supported almost since the beginning?

1.Oracle Database

2.SQL

3.SQL+

4.MySQL

Posted Date:-2021-07-17 09:14:12


Question:
Which one of the following function checks for the existence of DNS records?

1.checkdns()

2.checkdnsr()

3.checkdnsrr()

4.checkdnsa()

Posted Date:-2021-07-17 09:14:12


Question:
Which one of the following function is used to retrieve the MX records for the domain specified by hostname?

1.getmx()

2.retrieve_mx()

3.getmxrr()

4.retrieve_mxrr()

Posted Date:-2021-07-17 09:14:12


Question:
Which one of the following function is used to return an array consisting of various DNS resource records pertinent to a specific domain?

1.dns_get_record()

2.dns_record()

3.dnsrr_get_record()

4.dnsrr_record()

Posted Date:-2021-07-17 09:14:12


Question:
Which one of the following function is used to send an email using PHP script?

1.mail_send()

2.send_mail()

3.mailrr()

4.mail()

Posted Date:-2021-07-17 09:14:12


Question:
Which one of the following function is used to start a session?

1.start_session()

2.session_start()

3.session_begin()

4.begin_session()

Posted Date:-2021-07-17 09:14:12


Question:
Which one of the following function returns the port number of a specified service?

1.getportname()

2.getservername()

3.getserverbyname()

4.getservbyname()

Posted Date:-2021-07-17 09:14:12


Question:
Which one of the following functions are used to search a string?

1.preg_match

2.preg_search

3.preg_find

4.preg_found

Posted Date:-2021-07-17 09:14:12


Question:
Which one of the following is not a preg PHP function?

1.preg_match

2.preg_match_all

3.preg_matchall

4.preg_split

Posted Date:-2021-07-17 09:14:12


Question:
Which one of the following is the default PHP session name?

1.PHPSESSID

2.PHPSESID

3.PHPSESSIONID

4.PHPIDSESS

Posted Date:-2021-07-17 09:14:12


Question:
Which one of the following is the very first task executed by a session enabled page?

1.Delete the previous session

2.Start a new session

3.Check whether a valid session exists

4.Handle the session

Posted Date:-2021-07-17 09:14:12


Question:
Which one of the following preg PHP function is used to do a find and replace on a string or an array?

1.preg_replace()

2.preg_find()

3.preg_find_replace()

4.preg_findre()

Posted Date:-2021-07-17 09:14:12


Question:
Which one of the following preg PHP functions is used to take a string, and put it in an array?

1.preg_destroy()

2.preg_split()

3.preg_unchain()

4.preg_divide()

Posted Date:-2021-07-17 09:14:12


Question:
Which one of the following statements can be used to establish port 80 connection with www.nachi.com?

1.fsockopen("www.nachi.com", 80);

2.sockopen(80,"www.nachi.com");

3.fsockopen(80,"www.nachi.com");

4.sockopen("www.nachi.com", 80);

Posted Date:-2021-07-17 09:14:12


Question:
Which one of the following statements should be used to disable just the fopen(), and file() functions?

1.disable_functions = fopen(), file()

2.disable_functions = fopen, file

3.functions_disable = fopen(), file()

4.functions_disable = fopen, file

Posted Date:-2021-07-17 09:14:12


Question:
Which one of the following statements should be used to disable the use of two classes administrator and janitor?

1.disable_classes = “administrator, janitor”

2.disable_classes = class administrator, class janitor

3.disable_classes = class “administrator”, class “janitor”

4.disable_classes = class “administrator”, class “janitor”

Posted Date:-2021-07-17 09:14:12


Question:
Which one of the following statements should you use to set the session username to Nachi?

1.$SESSION[‘username’] = “Nachi”;

2.$_SESSION[‘username’] = “Nachi”;

3.session_start(“nachi”);

4.$SESSION_START[“username”] = “Nachi”;

Posted Date:-2021-07-17 09:14:12


Question:
Which parameter determines whether the old session file will also be deleted when the session ID is regenerated?

1.delete_old_file

2.delete_old_session

3.delete_old_session_file

4.delete_session_file

Posted Date:-2021-07-17 09:14:12


Question:
Which superglobal stores a variety of information pertinent to a file uploaded to the server via a PHP script?

1.$_FILE Array

2.$_FILES Array

3.$_FILES_UPLOADED Array

4.$_FILE_UPLOADED Array

Posted Date:-2021-07-17 09:14:12


More MCQS

  1. PHP Mcq Set 1
  2. PHP Mcq Set 2
  3. PHP Mcq Set 3
  4. PHP Mcq Set 4
  5. Current affairs mcq php
  6. Current affairs mcq php set 2
  7. Current affairs mcq php set 3
  8. PHP MCQ
  9. PHP MCQ Basics
  10. PHP Mcq Functions
  11. PHP Mcq Arrays
  12. PHP Mcq Basics of Object-Oriented PHP
  13. PHP Mcq Error Handling
  14. PHP Basics Mcq Questions
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!