All posts tagged ‘wiki’

File Under: Ajax

Ajax for Beginners

JavaScript has had the XMLHttpRequest object for almost a decade now, but it really only started getting wide attention in 2004. All this attention was mostly due to some showoff web applications that made every developer who saw them think, “I want my site to do that!” But it also has to do with the spiffy, spiffy name given to it by the folks at AdaptivePath, who named this asynchronized application Ajax. Maybe you’ve heard of it?

A few high-profile Google applications in particular made a splash with Ajax: Maps and Gmail were first. It also powers some of the core functionality in the user interface of the ever-so-popular photo sharing site Flickr. By now, Ajax has become integral to the fabric of the web, especially in the era of real-time applications like Twitter, Buzz and Wave (all of which use Ajax extensively in their webapp front ends, for the record). Ajax may also lay claim to being the first JavaScript object with its own fan website. Date.com doesn’t count, although I did have a scintillating chat with a lady there once about the getTimeZoneoffset method.

Continue Reading “Ajax for Beginners” »
File Under: Programming, Software

Generate PDFs Dynamically With PHP

PDF is the Portable Document Format developed by Adobe. It’s an open standard implemented by Adobe in their Acrobat series of software, but implementable and extensible by anybody who’s got the time, inclination, and knack. One trick that’s got a lot of potential is using PHP to dynamically generate PDF files and serve them via the web.

PHP can do a lot for your web operation (read our PHP Tutorial for Beginners tutorial). You can generate nice-looking printable receipts, invoices, and brochures. Disc-Cover has a test site that looks up info about a CD automatically and then generates a PDF label for the CD box that you can print, cut out, and use. And there are literally one billion other possible uses for dynamically generated PDFs.

So what are you waiting for?

You have a variety of PDF-generation options. The standard, classic way of doing it is with PDFlib. Because it’s so widely used and well-integrated into PHP, that’s the library I’ll go over today. But it’s by no means the only way of doing things. PDFlib is source-available, but not free. The license specifies that PDFlib can be used and redistributed without charge for non-commercial projects, but commercial use carries a fee.

There are also a number of completely free options. These include R&OS and FPDF, Panda. The choice is yours. (I haven’t had a chance to test these free packages very thoroughly. If you have had negative or positive experiences with them, please do let me know.)

Continue Reading “Generate PDFs Dynamically With PHP” »
File Under: Databases, Programming

Cake and Trax for Beginners

In my last article, Building With Ajax and Rails I made a faintly disparaging joke about some new web frameworks that have been created in fond imitation of Rails. I got a lot of feedback about that joke. I’m not allowed to comment here about the pending lawsuits, but I would ask that the drive-by eggings of my house and threats to my family please cease. (They’ve been relocated to a secret Webmonkey farm anyway.)

Today we’re going to take a look at a couple of those frameworks for PHP:Trax and Cake. Both attempt to bring the quick, easy, helpful tools and easily understood, easily maintained structure of Rails to PHP — a boon to web developers who know PHP and perhaps have some keeper code in that language, but can’t resist the Rails buzz. Both Trax and Cake use the same model-view-controller pattern and Active Record ways of addressing data that Rails does. Makes one curious, no? I don’t have time to get deeply into them today, but both stress “rapid development,” so let’s see if I, your average not-too-bright web developer, can get a little app off the ground before the end of this article.

Continue Reading “Cake and Trax for Beginners” »
File Under: Programming, Security

Stop Spam on Your Mail Server


Casual users of email are only mildly irritated, and even occasionally amused, by spam. “Just click delete!” they say. “One keypress and it’s gone! What could be easier?” The more of it you see, though, and the more wear your Delete key gets, the less tolerant you become. It’s like crazy people coming up to you on the street, perhaps. If you only ever see one, you laugh about his antics forever. If you see one a day, you start to think, “What a shame! Can’t something be done for these poor, poor people?” And if, everywhere you go, you are surrounded by crazy people raving in your ears and blocking your progress, it becomes impossible to get anything done. At that point, you’re basically working in Hollywood.

Spam, for the most part, is not profitable for the advertisers who pay to have it sent. It has an incredibly low success rate, and only seems like a good idea because it’s so cheap to reach millions of inboxes. The only guy who makes a profit is the middlemen:the spamhouses that take money from hapless breast-enlargement-pill manufacturers in exchange for almost-worthless bulk mailings. They use shifty techniques like forged email headers, automated freemail accounts, and bulk-mailing software.

When you start getting a lot of spam, or when you manage email for a number of people, it becomes crucial to sort the noise out of the signal. Because sorting by hand is tedious and unfeasible on even a moderate scale, the key is, of course, finding a way that a computer can distinguish spam from non-spam. A number of interesting solutions to this problem have been attempted.

In this article, it is assumed that you are running a mail server like the one described here:Set Up IMAP on Your Mail Server. Many of the techniques described herein will still be applicable on any Unix system, even if it’s just a mail client machine; and the principles apply to any email handling process.

Continue Reading “Stop Spam on Your Mail Server” »
File Under: Identity

Be Your Own Open ID Provider

OpenID is a burgeoning standard for identifying and authenticating yourself on the web. You do this by identifying yourself not with a standard username and password, but with a URL. This URL points to a web page that verifies that you are, in fact, you.

A number of third-party sites offer OpenID URLs to their users, including LiveJournal, AOL, and Technorati. But some people do not like to be beholden to third parties for something that may turn out to be a central part of their online identity, and they’d rather host their own.

An easy way to do that is with an open source PHP identity server called phpMyID.


Continue Reading “Be Your Own Open ID Provider” »