Archive for December, 2006
PHP Developer - December 29th, 2006
The PHP-GTK Community site has posted two new code examples today - one dealing with the GtkProgressBar and the other with GtkFileSelection.
The first, about the progress bar widget, gives a simple one window example of making the workspace, the bar object and showing how to make it step through the progress (expanding).
The second example demonstrates using the GtkFileSelection widget to allow the user to select a file off of the local file system and pass the value back into the script.
Continue Reading ·
PHP Developer - December 29th, 2006
A new tutorial has been posted over on AnyExample.com dealing with password generation in PHP. This type of script can be useful for creating a default password for your application to give initially to the user.
Modern web-applications often provide (during registration, or password-reset) random-generated passwords for its users. However these passwords (usually a random combination of letters or numbers) are quite hard to remember: in fact, it’s even impossible to read them. This article provides a function for generating English-like readable passwords.
The key difference in this script is that last sentence - making the passwords somewhat human-readable. They give an example of what the traditional (md5-ish) approach to making passwords is before giving the code to create something a bit easier to remember like “lyttakor” or “fapoution”. Example usage code is also provided.
Continue Reading ·
PHP Developer - December 29th, 2006
Matthew O’Phinney has a new post on his blog today talking about overloading arrays in PHP 5.2.0 using the magic __get and __construct functions.
Several weeks back, a bug was reported against Zend_View that had me initially stumped. […] Basically, __get() no longer returns a reference and returns values in read mode, which makes modifying arrays using overloading impossible using traditional methods.
He gives a code example of the problem and two ways to get around it - one using a switch statement to get around the problem and the other (”best solution”) was Matthew’s option to extend the ArrayObject class.
Continue Reading ·
PHP Developer - December 29th, 2006
Sara Golemon has posted her own look back at the year of 2006 in the PHP:
Well, Davey Shafik started us off with his year-end wrapup so I’ll follow suit with mine. The thoughts below are mine and mildly influenced by alcohol. They represent a foggy review of how I experienced the year through the imperfect recollection of mailing list archives.
She covers each month, looking at the people, events, and releases that happened in each. Lots of activity happened on the mailing lists mirroring the happenings in the rest of the PHP community. Check out her great post for the full happenings of the year.
Continue Reading ·
PHP Developer - December 28th, 2006
As mentioned on Digg, there’s a very simple guide to securing your PHP applications - or at least taking steps towards that.
For the purpose of this tutorial we have listed some commonly known attacks, and how to protect against them. This is crucial for beginners in PHP because PHP tutorials and basic documentation does not accentuate this problem enough. Examples are given that are vulnerable to attacks, and students are either not aware of the vulnerabilities, or are not adequately educated how to protect their scripts.
They topics they look at are SQL injections, XSS attacks, CSRF attacks, and PHP variable insertion. They talk talk about one of the best things you can do to help secure your site and its data - input filtering.
If you’ve been paying attention at all to the buzz in the PHP community lately, you’ll know that articles like this are nothing new. These are the same things other developers are commenting on as well. It is good to see it get more exposure via digg though…
Continue Reading ·