PHP
Almost two years to the day since the last release, I've put together a new version of IXR, my PHP XML-RPC library. I haven't published it on the site just yet as I want to make sure any bugs are iron...
It's finally here! Unfortunately PHP.net, while a great site in most respects, fails miserably when it comes to permalinks for news items and/or new software releases. You can grab it from their downl...
I linked to PDML the other day in my blogmarks, but beyond a cursory glance I hadn't really dug in to what makes it tick. Dumky over at Curiosity is bliss points out that it makes use of an ingenious ...
For as long as Apache 2 has been stable, the PHP manual has carried this strongly worded warning:
Do not use Apache 2.0 and PHP in a production environment neither on Unix nor on Windows.
I've f...
Zend have quietly released a veritable treasure trove of PHP 5 tutorials via their PHP5 InfoCenter:
XML in PHP 5 - What's New? by Christian Stocker
PHP SOAP Extension by Dmitry Stogov
SQLite...
I haven't blogged much about PHP in a while because I've been up to my nose in mod_python and loving every minute of it. This news is just too important to miss: PHP 5 Release Candidate 1 has been rel...
I'm not sure how I missed this, but Harry Fueck's new book The PHP Anthology was published by SitePoint back in December, as a hefty 2 volume epic. Harry is the guru behind PHP Patterns and really kno...
Here's an interesting topic for a conference: PHP and Web Standards, to be held in Manchester from February 20th to the 24th. I've devoted a lot of time and energy to combining the two for this blog -...
XML in PHP5: An in-depth look into advanced XML features (via Keith) does exactly what it says on the tin. Here are the bits that caught my eye:
HTML Support in ext/xml - PHP 5 can load in not w...
From the New York Times:
Computer security researchers have been watching the evolution of remote-access rogue programs as they have become more common and have put more machines under the contro...
Perls of wisdom in a sea of site mismanagement, via the ever-excellent Column Two:
The great surprise of the past five years of content management is that, despite all the hundreds of systems, no...
Harry Fuecks has been hacking on my XML-RPC library, and has released a new version with some significant changes. His article on phpPatterns describes the changes and provides a link to download the ...
It turns out that the Javascript on PHP.net mentioned previously was not deliberately obfuscated to protect the code from prying eyes; it was merely compressed to reduce the size of the script. See th...
PHP.net has a new feature on their search page - a really nice implementation of an auto complete text widget in Javascript. Even better, the search page is valid XHTML 1.0 Strict and uses CSS for the...
I tried out FUDforum last night, after Rasmus Lerdorf recommended it in a comment on Jeremy Zawodny's blog. Feature wise, it's pretty impressive but still doesn't quite do it for me - I want something...
Now this is cool: The joy of flush() shows how PHP's flush() function can be used to send data to the browser before a page has finished rendering. Check out Ben's demo page to see the trick in action...
I pair-programmed this code with Natalie just over a month ago, and I've now added it to my Kansas blog simplified comments system as mentioned earlier.
The problem is the age-old challenge of auto...
I've added a comment system to my new Kansas blog. Since the target audience for that site is friends and family rather than fellow web developers, I've taken a very different approach to processing t...
In switching from PHP to Python I'm discovering an increasing number of PHP functions that I've learnt to rely on but have no direct equivalent in the Python standard library. Often Python simply prov...
So, now that "talk like a pirate" day has sadly come to an end, it's time to reveal the five minute code hack that rendered my front page semi-legible for the best part of a day. It was actually prett...
Kellan Elliott-McCrea (author of the popular Magpie RSS parser): A Few Tips for Writing Useful Libraries in PHP. Kellan makes the interesting observation that PHP encourages a culture in which most de...
When writing an XML parsing class in PHP, don't forget the ampersands in the following code snippet:
xml_set_element_handler($parser, array(&$this, '_tagOpen'), array(&$this, '_tagClose'));...
I get one or two emails a week about my FormProcessor class, making it the most popular of all of the code experiments I've posted on this site. Each time I'm asked if I plan to update it soon, and ea...
HarryF's PHP5: Coming Soon to a Webserver Near You is the most detailed overview of the features we can expect from the next major PHP release that I've seen yet....
This looks like it could be really useful: an XPath implementation in pure PHP (no extra modules required), via More Like This....
I've been reading up on ColdFusion MX recently, and I have to admit it looks like a really nice piece of technology. I'd previously written ColdFusion off as being too simplistic and primitive, but ha...
I've fixed a small but vital bug in the Incutio XML-RPC library. The library was causing errors when certain unicode characters were used in strings. This is because I was using PHP's htmlentities() f...
DevShed have a new article on Date Arithmetic With MySQL, which acts as a kind of missing manual for MySQL's powerful date arithmetic functions. It reminded me of something I've been meaning to write ...
Dynamic XML conversion using the SAX parser and a stack is the best new article I've seen on PHPBuilder in a very long time. It introduces several interesting ideas. The first is something I've been t...
One of the golden rules of web site development is "never launch a new feature on Friday", because it's almost certain to break over the weekend while you're not around to fix it. I've just extended m...
Here's a great quote from Rasmus Lerdorf (the creator of PHP) for people who have become disheartened with PHP's lack of elegance when compared to other languages such as Python:
PHP has never be...
PHP Kitchen have compiled a list of PEAR tutorials, covering a number of useful PEAR modules. This is an especially important resource considering that PEAR's module documentation is probably the weak...
Keith is thinking about caching. He's drawn up a pretty interesting set of thoughts and requirements, such as support for conditional GET and fine-grained cache length control, and support for caching...
SitePoint: Storing Hierarchical Data in a Database, by Gijs Van Tulder. The article first shows how the easy way of storing hierarchies in a database, using parent fields and a recursive PHP function ...
Let's talk about form validation. Here's what I would class as the ideal validation system for a form in a web application:
The form is displayed; you fill it in.
You submit the form to the se...
I've changed the date heading for each post to display the relative time since the entry was posted, rather than absolute the date and time. My main reason for doing this is that it solves the timezon...
If the 309 buttons at Steal these buttons aren't enough for you, you can now generate your own thanks to a clever PHP script on Minimal Verbosity. Bill Zeller has made the source code available as wel...
I've been getting more database timeout errors today, probably due to increased traffic from links to recent entries. A permanent solution would be to switch to generating static HTML (this site is cu...
XUL: rendering GUIs with PHP and XUL to PHP-GTK, both on the excellent phpPatterns(). If you're using a Gecko-based browser be sure to check out the XUL Interface to phpPatterns() proof-of-concept, wh...
Lars Marius Garshol's XMLWriter class for Python struck me as a particularly elegant solution for generating simple XML documents without having to worry about encoding issues, missing tags and so for...
I'm experimenting with using MySQL full text indexing to generate a list of "related entries" for each entry (click on an item's permalink to see it in action). It works by concatenating the item's ti...
This site's RSS feeds now support Conditional GET. Since the feeds are dynamically generated on every request, adding support took a bit of hacking around with PHP. Here's the function I came up with ...
I'm using Smarty in a project at Uni at the moment, mainly as a tool to allow team members to modify different parts of the codebase without stepping on each other's toes. I've seen some good argument...
One of the things that has always bugged me about creating login forms for web based applications is that the password is passed in clear text when the user logs in. Even if you then set a session coo...
Finally some good documentation on using SOAP with PHP: PEAR::SOAP Client Fast Start and Extending PEAR::SOAP WSDL, both from the excellent phpPatterns....
An Interview with Sterling Hughes on PHP5 from the PHP-Con site:
Personally, while I have programmed with both C++ and Java, I am mostly a procedural guy. I feel that most object oriented program...
Ned Batchelder describes Verbose Python regular expressions. This is one of the things I've known about (as in known that they exist) for ages but have never got around to using. I've been working wit...
htmlcleaner is a PHP class which claims to be able to clean up the revolting HTML generated by Micrsoft's HTML libraries, in particular the one that is used for browser embedded WYSIWYG editors. We're...
I've been working in quite a roundabout fashion recently. My principle target is to build a collaborative blogging system. As part of this, I needed an RSS aggregator to allow a single blog to show th...
PhotoPal is a new PHP image gallery system by Noel Jackson inspired by the Photos section on Textism. The way it is implemented reminds me somewhat of the Blosxom philosophy - the album's structures i...
Clearing out some more tabs:
Common HTTP Implementation Problems is a W3C Note describing a whole bunch of best practises for serving up documents and designing URIs.
Iraq-O-Meter and Iraq Body ...
SmartPHP.net has some useful looking classes, including SmartTemplate (like Smarty but much simpler to use) and SmartCache, a very intelligent caching class that can be used to cache data objects as w...
Paul DuBois, the author of the huge great MySQL Book I have sat on my bookshelf, has a whole bunch of useful MySQL articles published on his site....
Wez Furlong is working on a generic PHP installation script. If he finds a nice solution to the safe_mode and open_basedir restrictions mentioned in his post this could be a hugely useful tool for the...
Sterling Hughes has posted the slides he will be using for his presentation on PHP 5 next week. They provide a great deal of insight in to the new additions to look forward to in PHP 5, including a fe...
coWiki is the first open source project I have seen being developed with PHP 5, using snapshots from CVS. It looks like a really neat wiki system. Of particular interest for PHP heads is the developme...
I ran an intermediate to advanced PHP session at University today, on behalf of BCSS. The turn out wasn't particularly impressive, probably because the only lecture today had been cancelled so there w...
Last week I commented that Sam Ruby's spell checking feature could be made even funkier with the addition of a javascript powered "corrections" menu. I spent a few hours this afternoon playing with th...
A great preview describing the features we have to look forward to in PHP 5. Proper object reference handling is going to be sweet....
This weekend I started work on my latest web project, further details of which will no doubt follow soon. For the moment I'll just say that it follows the classic news/articles/users with logins model...
Via Scott, a clever PHP technique for ensuring data sent to the browser as a cookie or hidden form variable isn't tampered with by the user:
If you're expecting to receive data in a cookie or a h...
In response to yesterday's screen scraping post, Richard Jones describes a screen scraping technique that uses PyWebPwerf, a Python performance measuring tool.
I forgot to mention it in the article...
MySQL Adds Subselects, Upgrades Performance and Security:
MySQL Version 4.1 includes support for SQL subselects, also called subqueries or nested queries, a powerful feature that lets users searc...
Pythonology (via Deadly Bloody Serious about Python) is a Python advocacy site aimed at software engineers and managers. The site has a fantastic collection of case studies, Python Success Stories, wh...
Codewalker.com have a tutorial up describing PEAR's ITX template system. Their forums also have an explanation of how bitshifting operators work in PHP (in the fifth message from the bottom of the thr...
I just noticed that PEAR is finally out of beta. This means that the PEAR installer will be included with PHP 4.3, but more importantly it means that the PEAR website finally has a usable navigation s...
Generating One-Time URLs with PHP has some simple example code which demonstrates PHP's file locking functions in action....
PHP5: Ready For The Enterprise? (via Scott) discusses forthcoming improvements in PHP5 and asks if they will lead to acceptance of PHP as a suitable language for enterprise applications. It looks like...
Via ReadingEd, an interesting article on the Object Oriented Evolution of PHP by Zeev Suraski (the Ze in Zend). As well as a history of PHP's OO support, the article provides some tasty snippets of in...
The aforementioned PHP training system was a mixed success. On the one hand, I discovered that trying to teach a room full of people is a lot tougher than I had expected (to cut a long story short, I ...
phpPatterns is a brand new site which advocates and documents the use of object oriented design patterns with PHP. It's a great concept and the site already has some impressive content (although it co...
I didn't take much notice of "funky caching" while reading through Rasmus Lerdorf's PHP tips and tricks presentation - I saw that it was talking about using custom 404 pages to serve up dynamic conten...
Rasmus Lerdorf has published a PHP Tips and Tricks PDF based on a presentation given at the recent PHPCon2002. The file is a veritable goldmine of useful information, covering topics including optimis...
I'm now running PHP 4.3.0pre2 and Apache 2 on my Win98 machine, thanks mainly to this excellent tutorial on installing PHP and Apache 2 on Windows. The PHP manual's Servers-Apache page also has a bunc...
Adrian Holovaty has been investigating the content-to-code ratio of various news sites compared to various blogs. Unsurprisingly the blogs win hands down due to the tendancy to use CSS to separate str...
I've been helping my girlfriend recreate her site using CSS and structural markup. She's new to web design and has been taking to CSS like a duck to water - as a veteran of Microsoft Word globally def...
Zend (the commercial company behind the PHP scripting language) have launched a redesign of Zend.com. My verdict on the new design ... terrible.
Non-standards compliant code and a huge mass of ne...
Scott Johnson's presentation on Software Engineering Practices for Large Scale PHP Projects is fantastic - lots of excellent practical advice for professional development with PHP. It's a shame the pr...
Making the Case for PHP at Yahoo! (via Jeremy Zawodny) looks like it was a great presentation. The slides include the reasons PHP was chosen over ASP, ColdFusion, JSP and Perl and has some interesting...
HarryF on the SitePoint forums has compiled a fantastic list of Advanced PHP Resources, with links to sites covering object orientation, general application design, n-tier layering and using PHP with ...
Virtual Interview: Vince Oostindie (via techno weenie). Vincent is the author of the excellent Eclipse Library for PHP and a regular on the SitePoint forums, where he frequently educates people in pro...
Brent Simmon's Law of CMS URLs:
The more expensive the CMS, the crappier the URLs.
The article includes an interesting comments thread discussing human readable URLs and why so many high end...
Does anyone know what's up with MySQLFront?
This project has been discontinued.This is really strange - a new version was released just the other weekend and now the project seems to have just termin...
The source code for my PingBack server, including the code I use to grab an extract from the page linking to my site, is now available here....
The Incutio XML-RPC Library for PHP (IXR to its friends) now has a forum. The forum is powered by incForum, Incutio's very own forum software written by my colleague Tim....
Announcing beta 1.5 of IXR, the Incutio XML-PRC Library for PHP. The library has undergone a complete restructuring and has a much cleaner design as a result. It also has a huge stack of new features,...
I was up most of the night working on a new version of my XML-RPC library (newly named IXR, for Incutio XML-RPC). I should have it ready for release some time today - it implements most of the extensi...
According to XML-RPC.com's Implementations page there are now 8 PHP implementations of XML-RPC! Looks like I wasn't the only person with an itch to scratch :)...
I've implemented PingBack on my blog. PingBack is a system for tracking who is linking to your blog in a controlled way, based on a post by Stuart a few months ago. The idea is that when you link to a...
I spent most of yesterday messing around with XML-RPC. There are a variety of XMl-RPC libraries available for PHP but none of them felt right for what I needed. So, I've written my own.
The Incutio...
Web Basics with LWP (via Scott) is an excellent tutorial on Perl's LWP, a powerful set of modules which make it easy to retrieve content from the web. I've been using the excellent Snoopy class for PH...
I've been playing with XML-RPC and PHP today. I ended up using Keith Devin's pleasantly straight forward library thanks to PHP's built in (and completely undocumented) XML-RPC support conflicting with...
Zend have a short tutorial on PHP Templating with Smarty....
R&OS PDF PHP classes (via tidak ada). This is the most useful PHP library I've seen in a long time. It allows dynamic generation of PDF files without needing any additional modules installed on th...
Today's pleasant surprise - while surfing around the Wireplay forums I came across a link to alliedassault.co.uk, a community site for Medal of Honour: Allied Assault. Imagine my surprise when I reali...
If I don't post much today it's because I'm hard at work on the new database driven version of this blog. I'm hoping to open souce it so I'm trying to design it to be as easy to customise and modify a...
An interesting thread on SitePoint about SQL injection attacks. One of the points brought up is that PHP is by default virtually immune to injection attacks thanks to magic quotes (discussed here yest...
Pink Goblin (otherwise known as HarryF) explains why magic quotes are evil. This is an issue that every PHP developer should be aware of, as it can cause all kinds of problems in your scripts if you i...
Michael V has written a couple of functions to apply my CSS numbered code listing technique to PHP's built in syntax highlighting....
The Free On-Line Dictionary of Computing does exactly what it says on the tin. It is available under the GNU Free Documentation License so I grabbed a copy of the archive (which expands to a 4MB text ...
MP3 Piranha is a clever application which indexes your MP3 collection and uses the Amazon Web Service API to look up the album cover, related albums and provide a link to buy the album from Amazon. Ou...
After a successful private beta, the new searchable css-discuss archive is ready for use by the general public. If you spot any bugs or have any suggestions for improving the archive please drop me a ...
Glen Murphy has released the source code to his innovative dChat PHP/DHTML chat system. I've been playing around with it this morning and it's a very nice piece of software. dChat uses an interesting ...
PHP Tip: You can access characters within a PHP string using the index of the caracter in curly braces after the variable name. For example, $string{0} returns the first character, $string{3} returns ...
Smarty 2.3.0 is out, and includes a useful new debugging function and support for assigning template variables by reference. I get a mention in the CHANGELOG for a small bug fix I submitted. Open sour...
Today's scary discovery: MySQL TEXT fields have a limit of 65,000 bytes. If you insert anything larger than that in to a normal TEXT field mySQL will silently truncate your data without telling you (m...
A thread on SitePoint got me thinking about how PHP's little known parse_ini_file() function could be used to easily manage multiple language versions of web site messages. Sections could be set up fo...
Peter Van Dijck has unveiled the Secret Metadata Project (here and here), so I hguess it's time for me to come clean as well :) I'm working with him on a proof-of-concept PHP application for XFML, his...
Yet another interesting take on XML metadata representations: FacetMaps. A facet map (as I understand it) is a way of combining facets with hierarchies, best explained by the excellent interactive thr...
I've been working on a PHP application that can take an XTM formatted Topic Map and convert it in to relational data in MySQL, run queries on it and convert it back to an XTM later. My work on the ini...
XML-RPC Class Server is a really clever piece of code. It consists of a single file which you can drop in a directory full of PHP .class.php files to instantly provide an XML-RPC interface to every cl...
I'm not sure how this one snuck under the radar, but PHP now supports object overloading (as of version 4.2.0). It can be implemented by creating class methods __set(), __get() and __call() and then a...
Vulnerability found in PHP 4.2.0 and 4.2.1 involving HTTP POST requests. The PHP group have released PHP 4.2.2 which fixes this problem....
I've updated PHP Amazon Search to implement a few more search methods, and altered the example script to allow searches for related items....
Amazon have launched a brand new web service interface to their huge database of products. I've been playing around with it, and I've knocked together a simple search engine example in PHP, with the c...
Python in PHP (via HarryF on the SitePoint Forums):As both a Python and PHP enthusiast, I wanted to bring these two systems together to promote even greater and more interesting development opportunit...
Yesterday I set up a Wiki for Smarty as well. I like Wikis. The WikiEngine used for Smarty and MACCAWS is called TaviWiki, and is implemented in PHP with a MySQL back end. I had previously deployed Ph...
Smarty at OSCON: Andrei Zmievski and Sterling Hughes will be presenting a tutorial titled "Template Architectures with Smarty" at the O'Reilly Open Source Convention in San Diego, July 22-26, 2002. Fu...
Quiet blogging day today, but I've been busy behind the scenes. Firstly I've been playing around with TaviWiki (an excellent PHP Wiki engine), using it as a proof of concept for a Wiki-driven small we...
PHP XML Classes - A collection of classes and resources to process XML using PHP. Includes PHP implementations of Xquery lite and RDQL along with parsers for RDF, RSS and RDDL....
Via techno weenie: A Python XML-RPC debugging proxy script. This solves the problem of XML-RPC errors from PHP being sent out with the XML-RPC response packet and breaking any XML parser trying to rec...
Rasmus Lerdorf (the creator of PHP) has a blog. His latest entry discusses Palladium, and asks if it will actually help build up the alternative market of non wintel users....
I'm suffering from a bizzare PHP bug. For some reason, POSTed form entries over a certain length are being lost when submitted to scripts running on this site. Here is a demo script which demonstrates...
Enterprise Application Architecture by Martin Fowler: A fantastic book on Object Oriented patterns and how they can be applied to large software projects. The book is available on the web as a work-in...
When developing PHP applications, I usually have a classes directory somewhere in which I keep all of my PHP classes ready for inclusion. I name the class files ClassName.class.php. Normally I have a ...
Kuro5hin are running a fascinating story on AudioGalaxy, written by one of the AudioGalaxy developers who wrote a large portion of the web interface code. It covers the history of the system and its r...
I'm currently reinstalling PHP on my Windows machine, and in doing so I came across this tutorial: Installing XSL and PHP on Windows. The tutorial provides all the necessary files and instructions to ...
I've lost count of the number of times I've posted this PHP tip on a forum somewhere, so I may as well blog it:
$string = <<<EOD
This string can contain both "double" and 'single' quotes,...
There's an interesting rambling thread on SitePoint at the moment which started off talking about coding standards but has moved on now to discussing OOP and eXtreme Programming. In it, I try to expla...
Interview with Andrei Zmievski on SitePoint. Andrei is the guy behind PHP-GTK, the project that enables developers to write client side GUI applications using PHP. He is also one of the two lead devel...
phpDocumentor version 1.1.0rc2 has been released over at www.phpdoc.org. The feature list (from their press release):
all known bugs in 1.1.0rc1 have been fixed
fully 25% faster than version 1.0.0
...
I've just finished rebuilding the main data file for this blog, after it became corrupted last night due to a "Disk Quota Exceeded" error. It looks like this was my fault - I inadvertantly filled up m...
Elm0 has suggested a solution to my XHTML validation woes in a thread on WMHub. He suggests using libxml to validate new entries against a DTD, via PHP's exec() function. It looks like xmllint is just...
I've been looking at PHP's XML handling functions (in particular the xml_parse() function) and I've suddenly realised the advantages of writing entries in valid XHTML. Before I started this blog one o...
I don't know how I missed this, but the PHP group have released an alpha version of PHP with the Zend Engine 2 (tarball / Windows binary). This is exciting stuff - the new scripting engine has vastly ...
Weblog TODO List
I've got the bare bones of a weblog up and running now - essentially the ability to add entries which are categorised and archived in a permanent location. Still to come...
An edit ...