tenpastmidnight blog

Making hay while the sun shines

PHP annoyances

I've been doing a batch of PHP coding for a client this week. Much of it has been pretty straightforward form stuff, but I got to putting an attachment on to an e-mail today and everything suddenly got very awkward.

I find the PHP way of coding a bit long-winded compared to ColdFusion, although no where near as bad as ASP. But I must admit, uploading the file and getting access to it was even easier than in CF. Unfortunately, attaching it to an e-mail, a one line piece of code in CF, turned in to a right mess of writing headers for the e-mail itself, having base64 encoded the attachment.

Paul and Matt pointed me towards a page about doing it with a PEAR addition, but unfortunately I'd all ready got so far in to the script I'd found it was quicker to fix what I had than start again.

Hopefully this is the sort of thing I can knock in to a handy function at some point. It would certainly have made my life easier when I was searching earlier today.

This page is powered by Blogger. Isn't yours?