CI_DB_query_builder::update()

update([$table = ''[, $set = NULL[, $where = NULL[, $limit = NULL]]]]) Parameters: $table (string) – Table name $set (array) – An associative array of field/value pairs $where (string) – The WHERE clause $limit (int) – The LIMIT clause Returns: TRUE on success, FALSE on failure Return type: bool Compiles and executes an UPDATE statement.

form_reset()

form_reset([$data = ''[, $value = ''[, $extra = '']]]) Parameters: $data (string) – Button name $value (string) – Button value $extra (mixed) – Extra attributes to be added to the tag either as an array or a literal string Returns: An HTML input reset button tag Return type: string Lets you generate a standard reset button. Use is identical to form_submit().

CI_Trackback::validate_url()

validate_url(&$url) Parameters: $url (string) – Trackback URL Return type: void Simply adds the http:// prefix it it’s not already present in the URL.

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

CI_User_agent::version()

version() Returns: Detected browser version or an empty string Return type: string Returns a string containing the version number of the web browser viewing your site.

CI_Calendar::generate()

generate([$year = ''[, $month = ''[, $data = array()]]]) Parameters: $year (int) – Year $month (int) – Month $data (array) – Data to be shown in the calendar cells Returns: HTML-formatted calendar Return type: string Generate the calendar.

remove_invisible_characters()

remove_invisible_characters($str[, $url_encoded = TRUE]) Parameters: $str (string) – Input string $url_encoded (bool) – Whether to remove URL-encoded characters as well Returns: Sanitized string Return type: string This function prevents inserting NULL characters between ASCII characters, like Java\0script. Example: remove_invisible_characters('Java\\0script'); // Returns: 'Javascript'

CI_Trackback::receive()

receive() Returns: TRUE on success, FALSE on failure Return type: bool This method simply validates the incoming TB data, returning TRUE on success and FALSE on failure. If the data is valid it is set to the $this->data array so that it can be inserted into a database.

hex2bin()

hex2bin($data) Parameters: $data (array) – Hexadecimal representation of data Returns: Binary representation of the given data Return type: string For more information, please refer to the PHP manual for hex2bin().

Create news items

You now know how you can read data from a database using CodeIgniter, but you haven’t written any information to the database yet. In this section you’ll expand your news controller and model created earlier to include this functionality. Create a form To input data into the database you need to create a form where you can input the information to be stored. This means you’ll be needing a form with two fields, one for the title and one for the text. You’ll derive the slug from our title in the