Setting path for PHP CLI

What is that for? my friend asked my a question after lunch. Well, install php using file from php.net don’t automatically set environment path for php location. As result we must type full location of php.exe each time we must execute php from command line. Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. …

More

Reset Cacti Password, step by step

My other staff  ask me password for username admin. Yes, its administrator level in cacti. After hardy trying to remember I gave up, I decide to reset it to other value but how? I try to find out using database approach : Here’s my steps : 1. Checking for cacti location and see db setting. …

More

PHP OO tutorials

Best way to learn scripting / program is easy. Just write the code and see the result. With the progress of OOP approach in field recently for our team make its ‘hard’ to adapt such change in mindset : Procedural vs Object Oriented Programming With case codeiginter,  we must learn the basic of OOP in …

More

nl2br, new line to br

I just forget this function when my friend ask me about strangeness in his data he store in mysql. He has address data in <textarea></textarea>, new line not converted to br as he thing. He just see all the input just store in single line. After search for a while I remember this gold function …

More

php explode() and wordwrap()

Whats the different of explode() and wordwrap() ? Answer : just see this example for explode() <?php $birthday=’1998-12-11′; //we need to split the component to date, month and year $day_parts=explode(‘-‘,$birthday); // we use – as tool to separate, now print $date_component=$day_parts[2]; $month_component=$day_parts[1]; $year_component=$day_parts[0]; ?> Wordwrap will ‘wrapping’ user input, like formatting crazy user who type …

More

101 CodeIgniter Resources

CodeIgniter already attract my attention since version 1.5, we even try to build application based on it. Beside its clear documentation, their user support awesome too. I’ll try to collect every resource that might useful to share with others who want to learn codeigniter. This post will be update regularly as soon as I get …

More

Make lowercase followed by uppercase data

Question : I have table A with field id, name and address. The data in name field seem not consistent, big letter name sometime found in record. How to update that field with uppercase in name field. For example :                  id              name                                       address                  1               FreAKHolicz  wORker            the moon                  2              tHE atMOSFER bluEZ            …

More

Export picture from mysql database to file

[amazonify]032152599X:left[/amazonify] As our data getting mobile and copying picture is annoying for me I decide to save the picture in the database (mysql). Another challenge came when other division need the data exported in a directory with same dimension (135 x 180 pixel). Structure for table ‘student_pic’  : CREATE TABLE `student_pic` (   `image_id` int(10) …

More

PHP 5.2.5 Released, 7 security enhancements & fixes

From php.net The PHP development team would like to announce the immediate availability of PHP 5.2.5. This release focuses on improving the stability of the PHP 5.2.x branch with over 60 bug fixes, several of which are security related. All users of PHP are encouraged to upgrade to this release. Further details about the PHP …

More

Create Paging with PHP : Link collection

Soon or later everyone who learn php will face this thing : ‘paging‘ blog, guest book, search result are using paging for displaying data. Make it easy to read and more friendly some picture of paging implementation :    Good paging code will survive when record in database or file system getting bigger. many url …

More

Multiple domains login in roundcube webmail

Roundcube is very good solution for webmail. I use squirrelmail for almost 4 years and I like it too. In production server I install squirrelmail and roundcube as well for give other user different experience using mail and mail2 as prefix and multiple domains need special attention in roundcube. After search in their forum I …

More

date.timezone in php.ini for php5

My last post about glitch in time related function for php5 I use a function date_default_timezone_set For global setting as always use date.timezone in php.ini just change from : ;date.timezone =Asia/Jakarta uncomment it first by remove semicolon mark into this : date.timezone =Asia/Jakarta save php.ini files and restart apache try view using phpinfo() you’re done

date_default_timezone_set for php5 date() fixation

Recent upgrade to php5 in appserv make me confuse when my friend ask me about this code : print date(‘d-M-Y H:i:s’); hour isn’t accurate after googling I found about date_default_timezone_set for full list of supported zone time see this link http://www.php.net/manual/en/timezones.php edit  the code into date_default_timezone_set( "Asia/Jakarta" ); // date.timezone = "timezone_here" print date(‘d-M-Y H:i:s’); …

More

Install gd support in php without xorg

Recent upgrade to php 5.2.3 require to install gd support too but it always need xorg. Here’s a lttle note on how to add gd support in php5 ports in freebsd without xorg. 1. Checking installed php extension proxy# pkg_info | grep php5 php5-5.2.3          PHP Scripting Language (Apache Module and CLI) php5-bz2-5.2.3      The bz2 shared …

More

php 5.2.3 upgrade more issue

Warning: session_save_path() [ href=’function.session-save-path’>function.session-save-path]: open_basedir restriction in effect. with error reporting set, blank page won’t give anything A little work need to be done since session not working properly after upgrade php from php 4.4.7 to php 5.2.3. After doing install and uninstall php5 ports in freebsd 6.2 box. I can see that error. Googling …

More