Larry Ullman

Translating Geek Into English

Installing PHP6 on Windows

When I went to write the third edition of my PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide book, I had to decide what version of PHP to support. PHP5 had been out some time and PHP6 was more than 50% ready to go. The primary alteration in PHP6 is support for Unicode, a change that Ruby is also making in version 1.9. This is a big deal, so I thought I’d include support for PHP6 in the book. Now, just over a year later, there’s no news on PHP6 and, from what I gathered, there’s not a pressing drive to get it out anytime soon, either. Such are the potential problems when it comes to writing about open source software: you really never know what you’re going to get or when. Obviously the situation isn’t ideal but only two chapters in the book require PHP6, and some features originally intended for PHP6 have been added to PHP5. Still, some users reading the book (rightfully) want to test or play with the forthcoming, primarily Unicode-related, features I discuss in those two chapters. In order to do so, you’ll need to do what I did in order to write the book: install a beta version of PHP6 on your computer. In this post, I’ll walk you through that process for Windows users (I’ll address non-Windows users separately).

Ubiquity Plug-in for Firefox

I came across the Ubiquity plug-in for Firefox the other day. If you use your browser a lot, and really like cool, cryptic ways of saving you steps, I could see this being revolutionary (on a personal level). I came across this after reading some stuff about my favorite utility, QuickSilver; the premise and usage of Ubiquity is comparable. Ubiquity allows you to tie other services into the current Web browser. For example, in this video, by one of Ubiquity’s creators at Mozilla, they show how to use Ubiquity to add a Google map to an email, then add a note to their calendar, without ever leaving the current browser window. Later in that same demonstration, part of a Web site is translated from Japanese to English, again, without leaving the current browser window. For more information, also see the other videos by Aza Raskin, http://labs.mozilla.com/2008/08/introducing-ubiquity/, and https://addons.mozilla.org/en-US/firefox/addon/9527.

To be clear, Ubiquity is still in a beta format, and it’s pretty geeky stuff. But if you’re the kind of person that likes cutting edge (but still useful) ideas, and/or, if you have some time to kill, check it out.

Selecting Elements in jQuery

\[intlink id="110" type="post"\]\[/intlink\]

, I discuss how to include the jQuery library in your HTML page and how to have JavaScript executed after the document has loaded. In this next post, I’m going to talk about referencing Document Object Model (DOM) elements using selectors. As much of using JavaScript in an HTML page involves manipulating the DOM, this is an important concept to get down.

Getting Started with jQuery

For some time now I’ve been meaning to write about jQuery, an increasingly popular JavaScript framework. There are a number of JavaScript frameworks available, all with their own strengths and weaknesses, so I don’t want to suggest that jQuery is the best one, but it does have its advantages. In particular, I like:

  • that there’s only one file to include in a page
  • how simple DOM (Document Object Model) references are, as manipulating the DOM is such a large part of Rich Internet Applications
  • the unobtrusive JavaScript approach

If you’re not familiar with this last concept, it involves keeping the JavaScript together, in the page’s HEAD, separate from the HTML. Pretty much anytime you separate X from Y (data from presentation, HTML from PHP, CSS markup from HTML, etc.), it’s a good thing. At the very least, abiding by unobtrusive JavaScript makes editing JavaScript easier. (There’s more to unobtrusive JavaScript than just this but…)

In this first post on jQuery, I’ll just discuss how to prepare a page to use jQuery. Over the next few days, subsequent posts will demonstrate more complex applications of jQuery.

Recreating MySQL Databases

One of the more common MySQL-related questions I get is how to transfer a database from one computer to another, or just how to recreate one in general. There are command-line tools that come with the MySQL server expressly for this purpose ( mysqldump and mysqlimport). However, most people prefer to avoid using command-line tools, if they can. You can also use the GUI MySQL Administrator. This application has Backup and Restore options. (I write about the MySQL Administrator in my MySQL, Second Edition (Visual QuickStart Guide) book.) That’s a fine application, but you may not be able to run a GUI tool on the destination server (e.g., a hosted Web site). What I almost always use is phpMyAdmin. This Web-based PHP interface to MySQL is installed on pretty much every hosted server and you can quickly install it on your own computer as well. Here’s how you would use it…

My Forthcoming E-Commerce Book

Later this year I’m going to write an e-commerce with PHP and MySQL book for Peachpit Press. This is a topic that’s often been requested by my readers and one I’m happy to finally address. I have written e-commerce chapters in my PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide and PHP 5 Advanced: Visual QuickPro Guide books, but not to this extent. Specifically, those examples were unable to demonstrate the payment gateway system, as that’s so particular to each individual situation. This new book, whose title is still being determined, will cover everything you need to know to create an e-commerce site using PHP and MySQL. I’m going to describe my intentions for the book here, then ask for any questions, comments, and suggestions that you, the potential reader, may have.

UPDATE: I’ve just posted the rough table of contents. My apologies for the delay on this and my sincerest thanks to those interested in the book!