Web Application Development MCQs with Answers
Practice important Web Application Development MCQs with answers and explanations.
Chapter: 14
Q161:
What must be set in php.ini to allow file uploads in PHP?
A. file_uploads = Off
B. file_uploads = On
C. upload_max_filesize = 10M
D. max_execution_time = 30
Correct Answer:
B
Chapter: 14
Q162:
Which directory should be created to store uploaded files according to the PHP file upload example?
A. uploads
B. files
C. temp
D. images
Correct Answer:
A
Chapter: 14
Q163:
What is checked first in the PHP file upload script to ensure a file is an image?
A. The file size
B. The file extension
C. The file's MIME type
D. The file's name
Correct Answer:
C
Chapter: 14
Q164:
What message is displayed if a file already exists in the upload directory?
A. "File uploaded successfully."
B. "File is too large."
C. "Sorry, file already exists."
D. "File type not allowed."
Correct Answer:
C
Chapter: 14
Q165:
What PHP function checks if a file is an actual image or not?
A. getimagesize()
B. pathinfo()
C. file_exists()
D. move_uploaded_file()
Correct Answer:
A
Chapter: 14
Q166:
What is the purpose of the fwrite() function in PHP?
A. To create a file
B. To write data to a file
C. To delete a file
D. To read data from a file
Correct Answer:
B
Chapter: 14
Q167:
What does the "try" block in PHP exception handling do?
A. Catches exceptions
B. Throws exceptions
C. Contains code that may throw exceptions
D. Defines custom exception classes
Correct Answer:
C
Chapter: 14
Q168:
How does a custom exception class in PHP differ from the standard Exception class?
A. It includes additional methods
B. It cannot be used to throw exceptions
C. It is not extendable
D. It changes the way exceptions are caught
Correct Answer:
A
Chapter: 14
Q169:
Which method in a custom exception class provides a custom error message?
A. getMessage()
B. errorMessage()
C. getCode()
D. getFile()
Correct Answer:
B
Chapter: 14
Q170:
What does the move_uploaded_file() function do in the PHP file upload process?
A. Moves the file to a temporary location
B. Moves the file to the final destination
C. Deletes the file after upload
D. Validates the file type
Correct Answer:
B
Chapter: 15
Q171:
What is WordPress primarily used for?
A. Creating spreadsheets
B. Building websites, blogs, or apps
C. Writing code
D. Designing graphics
Correct Answer:
B
Chapter: 15
Q172:
What programming language is WordPress written in?
A. JavaScript
B. Python
C. PHP
D. Ruby
Correct Answer:
C
Chapter: 15
Q173:
Which of the following is NOT a requirement for installing WordPress on a remote host?
A. Access to the web server www directory
B. A text editor
C. An FTP client
D. A JavaScript library
Correct Answer:
D
Chapter: 15
Q174:
To designate a static homepage in WordPress, you should go to which menu?
A. Appearance → Customize → Static Front Page
B. Pages → Add
C. Media Library
D. Plugins → Add
Correct Answer:
A
Chapter: 15
Q175:
What is the purpose of the Media Library in WordPress?
A. To manage user accounts
B. To view, edit, and delete uploaded media
C. To add new themes
D. To create custom menus
Correct Answer:
B
Chapter: 15
Q176:
What should you click to save a new menu in WordPress?
A. Save Changes
B. Save Menu
C. Publish Menu
D. Save and Exit
Correct Answer:
B
Chapter: 15
Q177:
Fill in the blank: The __________ allows you to preview changes to your site before publishing them.
A. Theme Customizer
B. Media Library
C. Plugin Manager
D. Widget Area
Correct Answer:
A
Chapter: 15
Q178:
Which of the following is an example of a free WordPress theme source?
A. http://www.templatemonster.com/wordpress-themes.php
B. http://themeforest.net/
C. https://wordpress.org/themes/
D. http://www.themezilla.com/themes/
Correct Answer:
C
Chapter: 15
Q179:
What is a plugin in the context of WordPress?
A. A piece of software to extend functionality
B. A type of theme
C. A content management system
D. A coding language
Correct Answer:
A
Chapter: 15
Q180:
Fill in the blank: To install WordPress locally, you need access to your web server ________ directory.
A. www
B. public_html
C. home
D. ftp
Correct Answer:
A