Archive

Archive for the ‘PHP’ Category

CodeIgniter Tutorial: [Creating Accounting Application] Part 2 The Application Specification and UML Diagrams

In this part of the tutorial series we will discuss about the application specification. After defining the user requirements we will do the analysis and designing the using UML use cases and class diagram. We are going to use a free UML diagramming tool called StarUML. You can download the program here if you have not installed it in your computer.

Read more…

  • Share/Bookmark

CodeIgniter Tutorial: [Creating Accounting Application] Part 1 Setting Up the Environment

This tutorial series explain how to develop a web based application using CodeIgniter, the PHP application framework. As you might already know, CodeIgniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications.

In this tutorial, we took the case of developing a basic web based accounting application that can input cash book and bank book data transaction and journal entry.

The tutorial series will cover:

  • Part 1 Setting Up the Environment: XAMPP (apache, mysql, and PHP) and CodeIgniter
  • Part 2 The application specification, analysis and design using UML use case and class diagram using free UML diagram tool StarUML.. (download here if you have not install it in your computer) . We also need to install StarUML PHP 5 Code Generator Template to automatically generate the class files from class diagram created
  • Part 3 ER Diagram and Creating Database using MySQL workbench, formerly fabForce ERD tools for MySQL
  • Part 4, preparing to code in CodeIgniter, exporting class diagram to PHP scripts
  • Part 5 Coding, the Mainpage
  • Part 6 Coding, the and COA Module explain the application coding using CodeIgniter
  • Part 8 Coding, the Cashbook Module explain the application coding using CodeIgniter
  • Part 7 Coding, the Bankbook Module explain the application coding using CodeIgniter
  • Part 8 Coding, the Journal Module explain the application coding using CodeIgniter
  • Part 9 Coding, the Reporting Module explain the application coding using CodeIgniter
  • Part 10 Conslusion and Further Development: AJAX, Facebook Application

Read more…

  • Share/Bookmark

PHP Library to Connect to LDAP Server

This article describes a simple PHP library to connect to an LDAP server to manipulate user data inside. The user manipulation includes adding, updating, changing password, and deleting user account. To use the library, simply include it to a script that do the manipulation.

Read more…

  • Share/Bookmark

Finding Element in an Array of Arrays

The listed PHP function can be used to find an element of an array that are a member of other array. For example we have a data structure like this:

$data = array(
    array(
        "user_id" => "akhdaniel",
        "group_id" => 1
    ),
    array(
        "user_id" => "amir",
        "group_id" => 1
    ),
    array(
        "user_id" => "abyan",
        "group_id" => 1
    ),
    array(
        "user_id" => "ujang",
        "group_id" => 1
    )
);

Read more…

  • Share/Bookmark
Categories: PHP Tags: ,

MySQL Backup to Email

Image representing MySQL as depicted in CrunchBase

Image via CrunchBase

This simple PHP script can be used to backup MySQL databases and then send the zipped backup file to email addresses. The backup file can then be restored by any MySQL front end program like the mysql command line, Navicat MySQL, or phpMyAdmin.

The logic of the script is really simple:

  1. initialization
  2. create backup sql file
  3. zip the file
  4. send email

Read more…

  • Share/Bookmark
Categories: Linux, MySQL, PHP, Windows Tags: , ,

Setup Google AdSense for Search in WordPress

In this article we are going to setup Google AdSense for Search in WordPress blog. It’s assumed that you already have a Google AdSense account which can be obtained easily from Google Adsense website. Read more…

  • Share/Bookmark

How to change upload file size on a Windows localhost

In a localhost Apache + PHP it is easy to change the uploaded file size to something larger than the default 16M.

An example below show you how to change the upload file size to say 50M.

  • Locate the PHP.ini file, for example in c:/xampp/Apache/bin/php.ini and open it with any text editor like WordPad by right-clicking -> Open With -> then choose WordPad.

Read more…

  • Share/Bookmark

Joomla 1.5: Mengganti Footer

Edit file file sbb: Languages – en-GB.mod_footer.ini ganti baris berikut ini.

FOOTER=Footer
FOOTER_LINE1=Copyright © %date% %sitename%. All Rights Reserved.
FOOTER_LINE2=<a href="http://www.joomla.org">Joomla!</a> is Free Software released under the <a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU/GPL License.</a>
MOD_FOOTER=<em>mod_footer</em>
THIS MODULE SHOWS THE JOOMLA! COPYRIGHT INFORMATION=This Module shows the Joomla! Copyright information

Atau cara lainnya adalah pada file <yourtemplate>/index.php di bagian paling bawah ganti baris berikut ini.

<p id="power_by">
<?php echo JText::_(‘Powered by’) ?> <a href="http://www.joomla.org">Joomla!</a>.
<?php echo JText::_(‘Valid’) ?> <a href="http://validator.w3.org/check/referer">XHTML</a> <?php echo JText::_(‘and’) ?> <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>
</p>

Akhmad Daniel Sembiring

Ligarwangi.com – Linux, E-book, Coffee, Gift, etc
vITraining.com – Qualified IT Products, Outsourcing, and Services

  • Share/Bookmark

Portable Apache, MySQL, PHP

Pada kondisi dimana user minta bisa mencoba aplikasi yang kita bangun menggunakan WAMP (Windows Apache MySQL PHP) dan belum terdapat server komputer yang dapat kita installkan infrastruktur yang dibutuhkan, kita dapat menggunakan portable WAMP yang dapat dijalankan dari USB.

Kondisi lainnya adalah ketika kita ingin membuat versi trial aplikasi web kita ke calon customer.

Salah satu yang dapat digunakan adalah USB Webserver (http://www.usberbserver.nl).  Aplikasi ini berisi Apache, PHP, dan MySQL yang telah dikonfigurasi dan siap dijalankan sehingga kita tinggal mengisi aplikasi web yang akan kita demokan ke client.

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
This site uses a Hackadelic PlugIn, Hackadelic SEO Table Of Contents 1.6.0.