Home » Archive

Articles in the PHP Category

Frameworks, PHP »

[14 Aug 2010 | No Comment | 86 views]

If you are running CodeIgniter 1.7.2, there is a security flaw with the file upload class. (fixed on July 12, 2010)  The easiest way to install the patch is to use the standalone patch http://codeigniter.com/download_files/CI_1.7.2_201007_sec_patch.zip and unzip the file to the Code Igniter system/libraries folder.

PHP, wordpress »

[28 Jul 2010 | No Comment | 258 views]

If you have noticed all your blog images breaking after upgrading to WordPress 3.0 from WordPress MU, you will need to make a simple change to the .htaccess file.

PHP, wordpress »

[12 May 2010 | 2 Comments | 711 views]

As an administrator for a WordPress MU install, I’ve been getting comments about the RSS feed in WordPress not fetching the latest feeds. The RSS feed information that appears on the page ranges from a fetch that is a few hours to a day old. I’ve confirmed this is an issue with 2.9. This is an issue for blogs that need to pull alerts from an RSS feed within a timely basis, e.g. every 10 minutes.

The workaround to this is to use the KB Advanced RSS feed plugin instead of the one that’s in WordPress.

Frameworks, PHP »

[20 Apr 2010 | 4 Comments | 1,188 views]

Reading Excel files in CodeIgniter is actually very easy once you have the right documentation. The first thing you will need to do is utilize the CodeIgniter “Upload” library and add in the Excel Reader library for reading the files. The documentation on the CodeIgniter website in regards to this Excel Reader library is missing some details in implementation. This tutorial will go through the steps of installing the Excel reader library and getting an example implementation working.

MySQL, PHP »

[12 Apr 2010 | No Comment | 405 views]

The error message looked like:
“Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (utf8_general_ci,IMPLICIT) for operation ‘find_in_set’”

I ran into this problem today while importing text from a CSV file. Evidently, the text format of the document had UTF characters, which caused CodeIgniter to error out when it tried to insert it to the database. The line had French characters (The ç in Français) My database fields by default are set to “latin1_swedish_ci” character set.

The fix?
I decided the best way to fix this was to set the Collation option for that specific field in the MySQL database to  “utf8_general_ci

PHP »

[22 Jan 2010 | No Comment | 683 views]

I noticed with the latest version of WordPress, an older template may not display the sidebar correctly. If you look at the source code, you notice a lot of HTML code is missing in the sidebar div. The easiest fix I found was to update the “sidebar.php” file in the template. Revised 4/28/2010 with a new fix.

Frameworks, PHP »

[6 Jan 2010 | No Comment | 490 views]

I’ve been noticing that a lot of documentation in CakePHP seems to be spread out onto many different sites. In my opinion, the CakePHP manual isn’t comprehensive enough for learning.

Here’s a list of useful CakePHP resources I’ve used recently:

CakeForge – Great resource for Open Source CakePHP applications. This site has many more applications than the CakePHP Bakery.
http://cakeforge.org/

Bakery – How to use different CSS files in CakePHP
http://bakery.cakephp.org/articles/view/some-ideas-to-organize-your-css-files-and-autoload-them-in-cakephp

Giga Promoters – CakePHP tutorials and scripts:
http://www.gigapromoters.com/blog/category/cakephp/

I’ll be updating this list as I find more resources.

PHP »

[9 Oct 2009 | No Comment | 1,269 views]

There appears to be an issue with cookies on Windows Safari that expires at UTC time and not according to the time zone on your machine.

I tested my PHP code

setcookie(“mycookie”, $sample_session_variable, time()+10000,’/mydirectory/’,'mysite.com’);

I verified that the cookie expires at the correct time for the following browsers

* Firefox 3.5
* Internet Explorer 8
* Safari (Apple OS X)

PHP »

[22 Jul 2009 | No Comment | 1,289 views]

WordPress 2.8.2 has been released. This affects both WordPress and WordPress MU. I recommend upgrading your current version since it contains a security fix.

WordPress 2.8.2 fixes an XSS vulnerability. Comment author URLs were not fully sanitized when displayed in the admin. This could be exploited to redirect you away from the admin to another site.

For more details, visit:
http://wordpress.org/development/2009/07/wordpress-2-8-2/

You can automatically upgrade WordPress within your control panel, or manually upgrade via:
http://wordpress.org/download/

WordPress MU download:
http://mu.wordpress.org/download/

Apache, Linux, PHP »

[2 Jul 2009 | No Comment | 1,112 views]

I recently implemented a way to limit access by IP range on specific blogs on WordPress MU. As you know, WordPress MU uses Apache Rewrite engine to rewrite URLs. For instance, you have a blog on WordPress MU called “intranet”. Apache Rewrite takes the “intranet” string in the URL and automatically rewrites it as a value in the PHP script. A side effect to Apache Rewrite is that “Directory” .htaccess parameters don’t work. So, if you wanted only your company IPs to access an internal blog, you will need to use Apache Rewrite parameters instead. For the solution, read on…