To prevent CSRF, a ________ token is often added to forms as a hidden field.

  • CSRF
  • Random
  • Session
  • Token
CSRF protection

Which method is used in CodeIgniter to encrypt and decrypt data securely?

  • Cipher library
  • Encryption is not supported
  • OpenSSL library
  • mcrypt library
CodeIgniter uses the OpenSSL library for secure encryption and decryption of data. OpenSSL provides a robust set of cryptographic functions, and CodeIgniter leverages it to ensure the confidentiality and integrity of sensitive information. Avoiding outdated libraries like mcrypt is crucial for maintaining security.

In the context of the Email Class, what is the significance of setting MIME types?

  • MIME types are irrelevant when dealing with emails.
  • MIME types are used to determine the file extension of attachments.
  • MIME types define the media type of the email content, such as text or HTML.
  • MIME types help in compressing email attachments.
Setting MIME types in the Email Class is crucial for defining the media type of the email content. For example, specifying 'text/html' indicates that the email contains HTML content. It ensures proper rendering on the recipient's end.

For enhanced security, file upload paths should be kept outside the ________ directory.

  • application
  • public
  • root
  • system
Keeping file upload paths outside the "application" directory is crucial for security. The "application" directory contains sensitive files related to the CodeIgniter application, and exposing it can pose a security risk.

What is the primary purpose of a Model in CodeIgniter?

  • Data manipulation
  • Database connectivity
  • File handling
  • User interface design
In CodeIgniter, a Model is primarily used for database connectivity. It facilitates data manipulation and interacts with the database, ensuring separation of concerns in the MVC architecture.

In CodeIgniter, where are log files typically stored?

  • application/logs/
  • logs/
  • storage/logs/
  • system/logs/
CodeIgniter log files are typically stored in the 'application/logs/' directory. This is the default location where the framework stores log files, and developers can access them for debugging and analysis purposes.

When experiencing database connectivity issues in a CodeIgniter application, the first place to check is the ________ settings in the database configuration file.

  • Connection Settings
  • Database Name
  • Hostname
  • Username
In the context of CodeIgniter, when facing database connectivity issues, the first place to check is the Hostname settings in the database configuration file. This setting specifies the location of your database server.

When designing a RESTful API in CodeIgniter, what format is typically used to send responses?

  • CSV
  • HTML
  • JSON
  • XML
In CodeIgniter, JSON is the typical format used to send responses in a RESTful API. JSON (JavaScript Object Notation) is a lightweight data interchange format that is easy for humans to read and write, and easy for machines to parse and generate. It is well-suited for representing structured data in the context of a RESTful API.

The function ________ in CodeIgniter is used to reverse all database actions since the last commit.

  • reverseCommit()
  • revertChanges()
  • rollback()
  • undoTransaction()
The rollback() function in CodeIgniter is used to reverse all database actions since the last commit. It's helpful when you want to discard changes made during a transaction.

Which file in CodeIgniter is used to set up database connection details?

  • config.php
  • connections.php
  • database.php
  • db_config.php
In CodeIgniter, the database.php file is used to store and configure database connection details, including hostname, username, password, and database name. This centralizes database settings.