Archive

Posts Tagged ‘CodeIgniter’

CodeIgniter Tutorial: [Creating Accounting Application] Part 5 The Mainpage

May 4th, 2010 admin 7 comments

Well I’m sorry, it’s been so long for this part to come.. I had been working very hard on some clients and don’t have enough time to write. Here’s what I had been done if you’re curious :) : http://maps.GpsTrackingIndonesia.com, www.SunberryCorp.com, www.mypushme.com, www.kulacak.com, www.web2trace.com, www.pushmeportal.com, … The fun is almost all of them was written with CodeIgniter :) .

Ok, let’s start with the easiest one first. We will create a simple menu page that contains links to other modules on the system. We put it on the Mainpage controller class.

Look at the Mainpage.php controller file. There is a function on it named exactly the same with the filename: Mainpage(). This should be exactly the same including the case. This is the constructor or initialization function of the class. Each time the class is called or instantiate, this function is called automatically. We put some initialization lines inside it:

Read more…

  • Share/Bookmark

How to Mix Segment and Query String in CodeIgniter

Passing parameter to a web page build with CodeIgniter (CI) can be done by using either POST variables which comes from HTML form or from the URI. But, different from traditional web application, by default CI only recognizes a segment based URI rather than query string format for passing parameter by URI.

In some circumstances we do need to use the query string to pass data to our page, which in this case using PHP global variable $_GET. By default, CI will not allow us to read the content of $_GET variable but instead using the URI class $this->uri->segment(the_segment_number).

Read more…

  • Share/Bookmark

CodeIgniter: koneksi ke port MySQL tertentu selain 3306

Secara default, database driver MySQL CodeIgniter konek ke port default MySQL yaitu 3306. Pada kondisi dimana port MySQL bukan 3306 misalnya 3307, CodeIgniter tidak punya option untuk menentukan pada port berapa MySQL berjalan.

Solusi untuk hal ini dapat dilakukan dengan beberapa cara:

  1. mengedit file driver database CodeIgniter: system/database/drivers/mysqli/mysqli_driver.php. Pada file ini dapat ditentukan port MySQL pada function ‘db_connect’ yaitu dengan menambahkan parameter $port pada function tsb:
    mysqli_connect
    ( [string $host [, string $username [, string $passwd [, string $dbname [, int $port [, string $socket]]]]]] )
  2. mengedit file PHP.INI, pada bagian  mysql.default_port, ganti dari 3306 menjadi 3307
  3. jika tidak punya akses ke file PHP.INI, bisa juga dicoba dengan mengedit file config/database.php nya CodeIgniter yaitu pada baris:
    $db['default']['hostname'] = "mysqlhost.yourdomain.com:3307";
  • Share/Bookmark

Ikutilah Seminar GPS! "MEMBONGKAR RAHASIA BISNIS GPS TRACKING" - Pembicara : Ir. Akhmad Daniel Sembiring (CEO Vitraining.com & GpsTrackingIndonesia.com) - Bandung, Sabtu 7 Agustus 2010 - Hotel Arion Swiss - Belhotel, Jl. Otto Iskandardinata No. 16 Bandung - Investasi : 2 Jt (sebelum 31 JULI 2010 HANYA 1 Jt) - Register ONLINE : seminar-gps.vitraining.com - More Info e-mail to : info@gpstrackingindonesia.com

This site uses a Hackadelic PlugIn, Hackadelic SEO Table Of Contents 1.6.0.