set_select()

set_select($field[, $value = ''[, $default = FALSE]]) Parameters: $field (string) – Field name $value (string) – Value to check for $default (string) – Whether the value is also a default one Returns: ‘selected’ attribute or an empty string Return type: string If you use a <select> menu, this function permits you to display the menu item that was selected. The first parameter must contain the name of the select menu, the second parameter must contain the value of each item,

set_checkbox()

set_checkbox($field[, $value = ''[, $default = FALSE]]) Parameters: $field (string) – Field name $value (string) – Value to check for $default (string) – Whether the value is also a default one Returns: ‘checked’ attribute or an empty string Return type: string Permits you to display a checkbox in the state it was submitted. The first parameter must contain the name of the checkbox, the second parameter must contain its value, and the third (optional) parameter lets you set an ite

set_radio()

set_radio($field[, $value = ''[, $default = FALSE]]) Parameters: $field (string) – Field name $value (string) – Value to check for $default (string) – Whether the value is also a default one Returns: ‘checked’ attribute or an empty string Return type: string Permits you to display radio buttons in the state they were submitted. This function is identical to the set_checkbox() function above. Example: <input type="radio" name="myradio" value="1" <?php echo set_radio('myradio

Server Requirements

PHP version 5.6 or newer is recommended. It should work on 5.3.7 as well, but we strongly advise you NOT to run such old versions of PHP, because of potential security and performance issues, as well as missing features. A database is required for most web application programming. Currently supported databases are: MySQL (5.1+) via the mysql (deprecated), mysqli and pdo drivers Oracle via the oci8 and pdo drivers PostgreSQL via the postgre and pdo drivers MS SQL via the mssql, sqlsrv (version 2

send_email()

send_email($recipient, $subject, $message) Parameters: $recipient (string) – E-mail address $subject (string) – Mail subject $message (string) – Message body Returns: TRUE if the mail was successfully sent, FALSE in case of an error Return type: bool Sends an email using PHP’s native mail() function. Note All that this function does is to use PHP’s native mail mail($recipient, $subject, $message); For a more robust email solution, see CodeIgniter’s Email Library.

set_cookie()

set_cookie($name[, $value = ''[, $expire = ''[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = FALSE[, $httponly = FALSE]]]]]]]) Parameters: $name (mixed) – Cookie name or associative array of all of the parameters available to this function $value (string) – Cookie value $expire (int) – Number of seconds until expiration $domain (string) – Cookie domain (usually: .yourdomain.com) $path (string) – Cookie path $prefix (string) – Cookie name prefix $secure (bool) – Whether to on

Running via the CLI

As well as calling an applications Controllers via the URL in a browser they can also be loaded via the command-line interface (CLI). Page Contents Running via the CLIWhat is the CLI? Why run via the command-line? Let’s try it: Hello World! That’s it! What is the CLI? The command-line interface is a text-based method of interacting with computers. For more information, check the Wikipedia article. Why run via the command-line? There are many reasons for running CodeIgniter from the command-

sanitize_filename()

sanitize_filename($filename) Parameters: $filename (string) – Filename Returns: Sanitized file name Return type: string Provides protection against directory traversal. This function is an alias for CI_Security::sanitize_filename(). For more info, please see the Security Library documentation.

Security

This page describes some “best practices” regarding web security, and details CodeIgniter’s internal security features. Note If you came here looking for a security contact, please refer to our Contribution Guide <../contributing/index>. URI Security CodeIgniter is fairly restrictive regarding which characters it allows in your URI strings in order to help minimize the possibility that malicious data can be passed to your application. URIs may only contain the following: Alpha-numeric t

safe_mailto()

safe_mailto($email, $title = '', $attributes = '') Parameters: $email (string) – E-mail address $title (string) – Anchor title $attributes (mixed) – HTML attributes Returns: A spam-safe “mail to” hyperlink Return type: string Identical to the mailto() function except it writes an obfuscated version of the mailto tag using ordinal numbers written with JavaScript to help prevent the e-mail address from being harvested by spam bots.