Learning On Demand Learning anything from anywhere

Archive for the ‘PHP’ Category

PHP OO tutorials

03.21.2008 · Posted in PHP

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 ...

nl2br, new line to br

03.20.2008 · Posted in PHP

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 ...

php explode() and wordwrap()

03.03.2008 · Posted in PHP

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 ...

101 CodeIgniter Resources

01.09.2008 · Posted in PHP

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 ...

Make lowercase followed by uppercase data

01.03.2008 · Posted in PHP

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            ...

Export picture from mysql database to file

12.11.2007 · Posted in Database, PHP

[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) ...

PHP 5.2.5 Released, 7 security enhancements & fixes

11.10.2007 · Posted in PHP

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 ...

Create Paging with PHP : Link collection

11.02.2007 · Posted in PHP

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 ...

Beware, wordpress exploit released, upgrade your wordpress!

09.15.2007 · Posted in PHP

From milw0rm exploits : # Pwnpress implements multiple techniques, bugs and tricks for compromising # WordPress-based blogs, combining the exploits in the necessary order for # retrieving any necessary information to make the exploitation process as # reliable as possible. # # Covertness capability is provided, dynamically adapting the payloads and # operations to lower ...

Multiple domains login in roundcube webmail

09.07.2007 · Posted in PHP, Unix

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 ...

date.timezone in php.ini for php5

08.29.2007 · Posted in PHP

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 ...