 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Havard Eide's Blog: SplObjectStorage
by Chris Cornutt July 23, 2008 @ 08:47:44
Havard Eide has a recent post to his blog that looks at a part of the Standard PHP Library (SPL) that can be used with objects to store them for later use - SplObjectStorage.
In this post I will look at SplObjectStorage: a container that allows to store objects uniquely without the need to compare them one by one.
He lets the code to most of the talking, showing how to do the standard operations for a data store - adding objects (both unique and the same), updating objects in the store, checking to see if an object is already added and removing an object from storage.
voice your opinion now!
splobjectstorage add unique update check data storage object remove
Ilia Alshanetsky's Blog: mail() logging for PHP
by Chris Cornutt December 13, 2006 @ 16:56:00
In his latest blog entry, Ilia Alshanetsky has proposed (and provided) a patch that can help with one of the more abused of the popular PHP functions out there - mail().
One of the problems with solving the mail() abuse is figuring out who is doing it or perhaps what script was exploited to do it, since the mail() function does not offer any logging mechanism.
To address this problem, he's supplied this patch you can apply to your source to add two new options to the mail function:
- enable the addition of the X-PHP-Originating-Script header
- mail.log (takes a filename) allows you to enable logging of every single mail() call
Check out his entry for more details on configuration options and other functionality included with the patch.
voice your opinion now!
mail logging function patch add header configure mail logging function patch add header configure
DevShed: Unit Testing in Detail
by Chris Cornutt October 26, 2006 @ 09:58:00
Continuing in their effort to help PHP developers keep their code bug-free, DevShed has posted part two of the series looking at unit testing your applications. Previously they had looked at the basics - of they work and what they're for. This time, they dig a little deeper, showing some of the additional features and conditions that PHPUnit has to offer.
This week, you will learn about running multiple tests simultaneously, creating more informative error messages, and more.
They get back into something they mentioned briefly before - packaging tests in a separate archive to keep it out of the main body of code (the same way separating content and display functionality is good). They also talk about how to run more than one test at the same time, a handy feature that lets you make regression tests.
They also show how to create more informative error messages and how to manually add more testing conditions for you to check custom bits of code that don't quite fit with the assertNull, assertEquals, and assertFalse crowd.
This article is an excerpt from the Sams Publishing book "Advanced PHP Programming" by George Schlossnagle.
voice your opinion now!
tutorial unit testing additional features test conditions add tutorial unit testing additional features test conditions add
Sitecritic.net: Simple Content Management in PHP Without Database Access
by Chris Cornutt August 10, 2006 @ 07:26:50
For all of the content management systems that are out there, most of them have something in common (well, a lot in common, but that's more than I mean) - they all use databases to manage their information. Sometimes, that's just not what a developer really needs. All they want is a simple, light, file-based solution. Well, this new tutorial from Sitecritic.net can help. It details the creation of a simple file-based management system, including login abilities.
A Content Management System (CMS) allows you to update your website easily without touching anything in the backend. If you are a non-IT person, you will almost always want a CMS for your website because it makes you less dependent on your web designers or developers to add, edit or delete contents in your website.
There are many good CMS out there but most of them require some sort of database access in the backend. Many PHP CMS uses mysql or postgres database which resides in the server. Installation and troubleshooting of CMS might require some technical knowledge and server configuration which could be daunting for some.
The tutorial steps you through the login form first, then creating the template HTML files, before adding in the adding and editing functionality to store the content in the files. The full source for the application is also available for download.
voice your opinion now!
content management system flatfile login add edit html content management system flatfile login add edit html
Joshua Eichorn's Blog: Adding AJAX to a website step by step
by Chris Cornutt August 08, 2006 @ 11:59:44
Joshua Eichorn has posted this new tutorial to his site today, a detailed look at how to add Ajax to just about any site out there with the help of the HTML_AJAX PEAR package.
When looking at a adding AJAX you have a couple decisions you'll want to make up front. One is what tools your going to use. In the webthumb case thats pretty easy. Webthumb is a simple PHP app and doesn't use a framework, so I need a nice general PHP/AJAX framework that is easy to use, HTML_AJAX fits that need.
After picking my tools I need to decide what my goals are. My main focus will be to improve usability, but I also want to use AJAX to make the site seem a bit flashier, so its a bit of a technology demo too.
He uses his own current project, Webthumb as an illustration of his points including looks at remoting, a RequestStatus class, exporting a class with the HTML_AJAX package, and finally, making the Ajax calls.
voice your opinion now!
html_ajax add ajax webthumb remoting requeststatus html_ajax add ajax webthumb remoting requeststatus
WeberDev.com: User Authentication With patUser (Part 2)
by Chris Cornutt June 17, 2006 @ 08:09:51
From WeberDev today, there's part two of their "User Authentication with patUser" series, this timie with a focus on managing user data with other patUser functionality.
patUser can do a lot more than just handle user authentication - the
library also comes with a large number of methods designed to make the task of managing user data as simple and efficient as possible. Over the course of this second installment, I'm going to show you how these methods work, and how they can be used to quickly create scripts to view, add, edit and delete users (and user attributes) from your database. Keep reading!
They build on the previous article's foundation (and database) to insert some new user information for manipulation and output. They then give some sample code to pull all of the users from the database, pull details for each user (including additional fields created in a database update), and limiting the results based on one of the fields.
They also include another database table and the needed code to help organize the users into groups. They also include the functionality to add and remove groups and users as well as adding and removing people to/from groups directly from the patUser setup. Finally, they finish it with a few "real life" examples to help it all make sense together.
voice your opinion now!
patuser user authentication management add remove update delete patuser user authentication management add remove update delete
Matthew Leverton's Blog: How to add a custom CAPTCHA to phpBB2
by Chris Cornutt May 27, 2006 @ 11:46:07
In this tutorial from Matthew Leverton, there's information on adding a step several phpBB users could benefit from - putting a CAPTCHA image on the comment form to reduce spam issues.
phpBB is "an open source, flat style, message board written in PHP." Because thousands of people use it with little or no modifications, it is a very popular target for spammers. They can use bots to automatically fill out the registration forms, including "clicking" on the activation link inside e-mails. A CAPTCHA is some sort of challenge that will (in theory) be easy for a human to solve, but hard for a computer to. Typically, they are implemented as a distorted word that the user must enter to complete the form.
He walks the reader through each step of the way, giving shell commands and configuration changes where appropriate. The addition makes use of the freecap CAPTCHA script, making it a simple process of including the library in and adding a few lines to the comment form code inside phpBB.
voice your opinion now!
php tutorial add captcha phpbb2 freecap library php tutorial add captcha phpbb2 freecap library
|
Community Events
Don't see your event here? Let us know!
|