SXSW 2010, PHP for Absolute Beginners, and an Apology

I know I've been silent on here for far too long, but I wouldn't have done it without good reason. Here's what I've been up to over the last two months!

PHP for Absolute Beginners

At long last, I've finally finished my first book! It's called PHP for Absolute Beginners, and it should be on shelves in major booksellers next month sometime. It's already available for preorder on Amazon (though you'll have to forgive the erroneous reference to PHP 6; I've been trying to get that removed for a couple months now), and I'd really appreciate presales.

Despite the title touting the book as written "for absolute beginners," this book should have something for everybody. It covers the construction of a blog from scratch, including using .htaccess to create friendly URLs, resizing and resampling images... read more

JSON: What It Is, How It Works, and How to Use It

My apologies for the lapse in posting; I'm in the midst of finishing my first book for Apress (it's called PHP for Absolute Beginners, and should be out later this year), and it's been consuming most of my attention.

This week, however, I want to cover a topic that I feel has become an important part of any developer's toolkit: the ability to load and manipulate JSON feeds from other sites via AJAX.

Many sites are sharing data using JSON in addition to RSS feeds nowadays, and with good reason: JSON feeds can be loaded asynchronously much more easily than XML/RSS.

This article will cover the following:

  • What is JSON?
  • Why does JSON matter?
  • How do we load JSON into a project?
We'll also use our... read more

Easily Create External Links Without the Target Attribute

Today's tip is extremely short and simple, and to a lot of folks may be a "Duh!" sort of tip, but I felt it was worth sharing.

I'm a big fan of keeping sites valid in XHTML 1.0 Strict. When I first started paying attention to standards, one of the things that stumped me right off the bat was the use of external links.

The Problem with target="_blank"

As I'm sure most people know, the use of the target attribute isn't considered valid. However, in order to open links in a new page, the only tool provided by HTML is the target attribute!

I had been creating external links for as long as I could remember using the following format:

<a href="http://example.com" target="_blank">External link</a> The Fix: rel="external"

The HTML When... read more

Show the Most Popular Categories with PHP

This week, we'll be going over a quick way to determine what the most popular tags are in a series of tagged entries.

Files and Data Required for This Exercise

Files

  • popular_tags.php — This will contain the dummy code and the function to process it
  • Data
  • Tags — An array of comma-delimited strings containing tags
  • Parsing Function — Function to break apart the array and determine which tags are the most popular
  • The Tag Sets

    For this exercise, we'll be using a comma-delimited string (i.e. "tag 1, tag 2, tag 3, etc.") as a set, and we'll assume that there are multiple entries, each with a set of tags generated by the user.

    Pretty much every blog, bookmarking resource, and app these days features tagging in some capacity. Tags help users quickly identify what an... read more