Posts

Showing posts from April, 2015

checking the detail of database table in codeigniter

These functions let you fetch table information. $this->db->list_tables(); Returns an array containing the names of all the tables in the database you are currently connected to. Example: if ($this->db->table_exists('table_name')) {    // some code... }

Get all detail from ip address

function ip_details($ip) { $json = unserialize(file_get_contents("http://ip-api.com/php/".$ip."")); return $json; } and you get a response like Array (     [city] => city name     [timezone] => timezone     [status] => success     [regionName] => State     [lat] => 26.223600387573     [isp] => your operator name     [as] => operator registration     [query] => ipaddress     [region] => statecode     [zip] => zipcoe     [org] => your broadband organizxatio     [country] => country name     [countryCode] => country code     [lon] => 78.17919921875 )

create index in the database table to make your result response faster

The CREATE INDEX statement is used to create indexes in tables. Indexes allow the database application to find data fast; without reading the whole table. An index can be created in a table to find data more quickly and efficiently. The users cannot see the indexes, they are just used to speed up searches/queries. here in the below you find a video how to create the indexes in database https://www.youtube.com/watch?v=zmAMXSr8zio

Get location detail from the ip address

function ip_details($ip) {     $json = file_get_contents("http://ipinfo.io/{$ip}");     $details = json_decode($json);     return $details; }

Build, test, and document your APIs faster organize your collection of webservices

With Postman, you can construct simple as well as complex requests quickly, save them for later use and analyze the responses sent by the API. Postman can dramatically cut down the time required to test and develop APIs. Postman adapts itself for individual developers, small teams or big organizations equally well.

Merge JS and CSS file to make your codeigniter website faster using CARABINER library

Carabiner is a library for managing JavaScript and CSS assets. It's different from others that currently exist (for CodeIgniter, anyway) in that it acts differently depending on whether it is in a  production  or  development  environment. In a production environment, it will combine, minify, and cache assets. (As files are changed, new cache files will be generated.) In a development environment, it will simply include references to the original assets.

set focus to the next text box

<form action="" method="post">      <h4>change focus</h4>     <input type="text" class="change_focus" name="textboxnumber-0" />     <input type="text" class="change_focus" name="textboxnumber-1" />     <input type="text" class="change_focus" name="textboxnumber-2" />     <input type="text" class="change_focus" name="textboxnumber-3" /> </form> <script> $('.change_focus').keyup(function(e){         $(this).next('.change_focus').focus(); }); </script>