Archive for February 6th, 2007

Creating an RSS Reader: the Reader

In this article we are going to discuss how to create a PHP-based RSS reader. It would be helpful if you know something about XML but not really necessary. RSS documents have three main tags Title Link and Description. And they all do exactly what their names suggest. I will go into detail about these tags in my second article dealing with building an RSS file. For now we will only focus on the reading part of the article….

Refurbished and Used Networking Equipment Network Liquidators sells refurbished and used networking equipment for up to 95% off list, with a 1 year warranty. We buy and sell top brands like Cisco, Extreme, Foundry, and more. Call us for best pricing.

Continue Reading · Add comment

Pierre-Alain Joye’s Blog: imagerotate, little confusions in the manual (damned, I cannot say RTFM!)

Pierre-Alain Joye is looking to clear up some confusion with his new blog post today surrounding the imagerotate function and some of its options:

imagerotate has special intern functions when the rotation angle is a multiple of 90 degrees, it actually only flips the image. The operation is quite fast as it is a two nest loops with a little copy operation. However it looks like the manual has a little mistake in the function description, which can lead to confusion.

The problem comes from a part mentioning the scaling down of an image to fit into the destination image. With a flip of 90 degrees, though, the resulting image contents will stay the same size as the original - the image only flips, not really rotates.

Continue Reading · Add comment

Community News: DreamStats “rootpath” File Inclusion Vulnerability Identified

As the International PHP Maagzine reports today there’s been a file inclusion vulnerability found (from Secunia) in the DreamStats package:

Secunia’s latest advisory points out a vulnerability in DreamStats, which could be exploited by remote attackers to execute arbitrary commands. This issue is due to an input validation error in the “index.php” script that does not validate the “rootpath” parameter, which could be exploited by remote attackers to include malicious PHP scripts and execute arbitrary commands with the privileges of the web server.

Those at risk are systems running versions 4.2 and prior and should update immediately. DreamStats is a package for displaying the statistics for Call of Duty related games on a website.

Continue Reading · Add comment

Community News: MySQL native driver for PHP - mysqlnd

In case you’ve missed it, the PHP community has been buzzing about a new set of mysql drivers created especially for PHP - the mysqlnd driver set.

The MySQL native driver for PHP is an additional, alternative way to connect from PHP 6 to the MySQL Server 4.1 or newer. It is a replacement for the libmysql, the MySQL Client Library. From now on you can use ext/mysqli either together with libmysql as you did in the past or with mysqlnd.

Several bloggers have been talking about it, including:

You can get complete information and download the software from the package’s page over on the MySQL.com website (including some simple install instructions).

Continue Reading · Add comment

Felix Geisendorfer’s Blog: Making error handling for Model::save more beautiful in CakePHP

In a new post to his blog today, Felix Geisendorfer shares a method to make error handling in the CakePHP model functionality a bit more “beautiful”.

Now I’ve written actions like the one above in the past as well. It’s just that I’ve not had many MySql errors since I’ve switched to CakePHP. The Model class usually handles all the DB operations flawlessly and it’s probably been over a year that I’ve written a custom MySql statement in my code somewhere. However, even CakePHP or, what’s more likely, the database can fail or deny operations.

He shows some code snippets of what he sees as less beautiful versions of database insertion code, methods that either don’t check the response/errors or make a messy job of it. His solution works by returning the result into a switch statement to check the results and handling it there (versus a series of ifs). There’s a class you’ll need to make it work (Common), but he shows how to use it and creates a simple “add” example with it and a new Controller to handle the request.

Continue Reading · Add comment