PHP

Introduction to the Yii PHP5 Framework

Yii is an excellent, open source, user friendly PHP application framework with a rich set of features built-in from the start, making website application development a breeze. If you're doing web application development and aren't yet using a framework, I'd highly recommend Yii.

Drupal 6.22 Upgrade

It's that time again... Drupal.org have released their latest version of the Drupal 6 CMS system.

Although there doesn’t appear to be any security related fixes from 6.21 to 6.22, we still advise everyone using our UK web hosting to update their Drupal 6 installations as a matter of course. Any users running installations below 6.21 should upgrade as a matter of urgency, as some cross site scripting security issues were fixed in that version.

Upgrading CakePHP

Upgrading or migrating CakePHP can be quite a daunting task to the uninitiated, but in most cases the process is as simple as any other PHP application. How complicated the upgrade/migration is going to be is dependant on whether you are moving up the major or minor version path.

Moving from a minor version is considered an 'upgrade', whereas moving from one major version to the other is considered a 'migration'

Redirecting Domains with PHP

Ever wanted to redirect one of your domains to point to another location?

With PHP this can easily be achieved using the 'header()' function. To redirect a request from oldsite.com to newsite.com, you could simply place the following code in the index.php file in the root of oldsite.com:

<?php
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.newsite.com" );

?>

Print an Array in PHP

Printing an array can be quite useful when debugging your PHP code and luckily PHP makes the task simple.

The print_r(array) function takes any array as an argument and iterates through it, printing the results to standard out as it goes.

PHP Include Files

Including other files in your PHP code is a common task. If you look at the big PHP frameworks and applications out there like CakePHP and Joomla!, you’ll notice lots of ‘include()’ statements.

The include statement tells the PHP parser to insert the content of a file directly in the location you have specified in the current PHP file.

PHP include_once

This PHP statement is very similar to include(), the only difference being that include_once() does exactly that.
The specified include will only be included in the running script once.

The standard include() statement could potentially include the same file many times during the execution of a script.
By using the include_once() statement, you ensure that the script is only ever included in the current execution path once.

Syndicate content