January 22, 2008 – 5:51 pm
All clients love data! The only thing they like more than data is data in a spreadsheet, and that’s where we would be in all sorts of trouble if we had to rely on special export libraries that in turn have to keep track with the dataformat - whims of Microsoft. Thankfully there’s a more durable solution, so your application will still be happily exporting in the future.
So here’s how you can quickly spit out a table for Excel:
(more…)
January 20, 2008 – 9:28 pm
Here’s another config - particularity of PHP, right up there with my beloved register_globals run-ins and $_REQUEST access issues..
Recently I’ve had to deploy a site on a server that had short opening tags disabled, and no access to the php.ini. Wow, didn’t see that coming.
Now, for my scripts that didn’t really mean a thing, since I habitually start a multi-line php code block with <?php, however, I do like using <?= within my “templates” (or view files), rather than <?php echo, because, well it keeps things “template-ier” IMHO. Almost as short as the smarty tag, eh?
So what to do avoid string replacing the hell out of your front-end?
(more…)
January 19, 2008 – 1:05 pm
For everyone looking for a clean & simple Apache + php + mySQL development environment for their local machine, XAMP is an all-in-one solution that installs in seconds. I use it on my Windows XP laptop, but it’s also available for Linux and Mac OS.. plus, it’s free. ( get it here )
Here’s how you go about running multiple sites on your local machine (and this might be common knowledge, but it took me a little research to find how to do it..):
(more…)
January 18, 2008 – 5:50 pm
I may be wrong, but there really only seems to be one “niceforms” plugin available for JS (this one by BadBoy), and I was so happy to see that it’s been ported to jQuery style by Lucian Lature (get it here).. Recently I’ve used it on a project, and it turned out that it breaks under certain conditions:
- only works properly for one form on the page (if used on more than one form, selects reference the wrong elements)
- the “onChange” event disappeared
Since the client already signed off on the design, I tried fixing it, and heeey, it actually works! Based on the fact that I only had to change about 3 lines, I’d say it’s probably right
. (See: The implicit rightness of elegant code)
Here’s the updated version: (Updated Niceforms for jQuery)
Changes: “niceform” class should now be attached to a container (div, for example) that the form resides in. Keep in mind that there might still be broken functionality under the hood. I only fixed it to the point where I could use it for my project.
Enjoy
PS: Post a comment if you find a newer / better version of this plugin.
– 5:46 pm
This package provides functionality to manipulate files on the server. This includes type and size validation, uploading, image resizing, MP3 - ID3 tag parsing, etc..
The need for this package really came up around the third time I had to accept file uploads from a site… first, there is a lot of steps you have to take that the file is actually there and valid (depending on varying criteria), and then I could never remember the proper syntax for moving files. This doesn’t even include validating target destinations and creating directories.. Pretty annoying!
So as you can see, plenty of opportunity for encapsulation. Enter the FileSystem Package…
(more…)
– 5:13 pm
Ever heard of the mail() function? Well, there’s another syntax I can’t remember.. and boy, when this function fails, there’s usually an unhappy client at the horizon, so the more of a strict interface I can get, the better. (Me likey strict
)
Enter the HtmlMimeMail class, a nice convenience class that comes with a few extra email perks, such as:
- sending attachments
- sending html and text version at the same time
- setting email priority
- easy CC and BCC syntax
- embedding images within email
Get the latest version here .