Archive for February, 2006

Feb 25 wufoo Posted at 8:16 pm | 3 Comments »

If you are struggeling with forms, you need to checkout the demo over at wufoo.com. Unfortunately, it’s still in development, so there is nothing to grab. But the outlook is pretty exciting. A very intuitive interface for sure, so pay those guys a visit.

Feb 23 phpCache — speed up your website Posted at 9:00 am | No Comments »

Caching seems to be the new trend. But aside from all the marketing, it’s really a lot more than that. If you don’t have the money to buy those lovely Zend products, you might find yourself turning to the world of Open Source (again). And viola! You’ll be helped.

There are two ways to cache with PHP - as far as I know -, one is using PEAR’s Cache_lite class. There’s an article already about it on Devshed, but since someone already spoiled it and I am not too much of a pear-lover myself (I like wine-berries, oranges and stuff), I’ll talk about phpCache. So here we go.

So, at first we’ll start with the principals. What does this caching thing do? And why do I want it?
Caching is used in a million things. For example, there is your browser’s cache, which saves a website to your harddrive so next time, you go to this website, it’ll come up a lot more faster on your screen. Your ISP probably also offers caching through a proxy server. In this case, highly frequented websites are downloaded to the ISPs proxy server and delivered to you a lot faster than if you would go to the site directly. Thumbnails of larger images are a way of caching too.

In this case, phpCache will save the contents of a so called “dynamic website” to the filesystem and read it until the scripts says, “Outdated!”, and regrabs the contents from the database to store them in the filesystem again, and again, and again. That’s basically how they all work. Basically - without the tech mumbo jumbo!
The reason “Why?!” is that for example if you have a high traffic site and a frontpage that pulls a lot of news from your database, you might run into a small problem. Thousands of visitors come to your site each hour (or minute) and each of those thousand requests equals an SELECT-statement which pulls the desired information from your database. The pulls equal load on the database which in return consumes memory and CPU and we would like to stay as slim as possible, won’t we?

Now that we found out, that we want to cache and since we have the latest package of phpCache handy, let’s hop on the shell and get the magic going.

Get the party started!

phpCache is a small little something, that can be found at http://0×00.org/php/phpCache/. Go there, grab the latest version and off we go.

On my servers, I like to organize my webs in the following manner:

/web/htmlcenter.com/
/web/htmlcenter.com/forums/
/web/htmlcenter.com/forums/docroot/
/web/htmlcenter.com/forums/logs/
/web/htmlcenter.com/www/
/web/htmlcenter.com/www/docroot/
/web/htmlcenter.com/www/logs/
...

The reason why I do it, I like to have everything that belongs to a web in one place. Whenever I need to get rid off a web, or in case of a backup, I just delete or tar the directory and get virtually everything that belongs to the web. In my case, everything except the database and mail.

Now that we downloaded the archive into /web/htmlcenter.com/forums/, we’ll extract it.

shell# tar zxvf phpCache1.4.tgz
phpCache-1.4/
phpCache-1.4/ChangeLog
phpCache-1.4/KentuckyFriedCache.pl
phpCache-1.4/LICENSE
phpCache-1.4/README
phpCache-1.4/gc.php
phpCache-1.4/phpCache.inc
phpCache-1.4/demo/
phpCache-1.4/demo/all.php
phpCache-1.4/demo/eatCPU.inc
phpCache-1.4/demo/expire_every10s.php
phpCache-1.4/demo/expire_mtime.php
phpCache-1.4/demo/pager.php
phpCache-1.4/demo/session.php
phpCache-1.4/demo/simple.php
phpCache-1.4/demo/thumbnails.php

(Hint: 1.4 was the latest version when I wrote this article.)

To make it look more pretty you can use the following:

shell# mv phpCache-1.4 phpCache

Which renames the directory. And makes it more easy to remember the name.
If you’d like to change the path, where phpCache saves the files to, you should use your favorite editor (vim, vi, pico, ee, joe, …) and edit phpCache.inc. If you can live with /tmp/phpCache, you keep it that way. Since I like to keep everything together, I adjusted the path to /web/htmlcenter.com/forums/phpCache/cache/ and saved the file.

If you create another directory, make sure that you set the correct permissions. In general:

chmod 777 directory_name/

Since the directory that we create for phpCache needs to be writable for everyone, I like to keep it outside the document root. Otherwise, people who go to my website could exploit the fact that a directory, that is writable for everyone is accessable to the public. Of course there is not just one way of doing it, but keeping the cache outside the document root might just be the most easiest/convenient one.

Cache it, baby!

Now, let’s assume, our script looks the following:

// pull the three latest records
$query=”SELECT title, id, teaser FROM news ORDER BY date DESC LIMIT 3″;
// execute query
$rawdb=@mysql_query($query);
// check if the query was successful AND if it returned records
if($rawdb AND @mysql_num_rows($rawdb)>0){
  // outputs the records
  while($array=@mysql_fetch_array($rawdb)){
    extract($array);
    echo ‘
include(’../path/to/phpCache.inc’);
if(!($et=cache(60)){ // We’ll cache the database output for 60 seconds. :-)
  $my_news=array(); // Create an array to store the news in
  $query=”SELECT title, id, teaser FROM news ORDER BY date DESC LIMIT 3″;
  $rawdb=@mysql_query($query);
  if($rawdb AND @mysql_num_rows($rawdb)>0){
    while($array=@mysql_fetch_array($rawdb)){
      extract($array);
      // store the info in the array
      // the info is appened
      $my_news[]=htmlentities(’     endcache();
  }else{
    if(!$rawdb){
      echo ‘Error: ‘.mysql_error().’
Query: ‘.$query;
    }else{
      echo ‘No news…’;
    }
  }
}
/*
  debugging
  echo ‘The cache expires in ‘.$et.’ seconds!’;
*/
// output the cached array
for($i=0;$i<;count($my_news);$i++){
  echo $my_news[$i]; // prints the news
}
// That’s all folks!
?>

So what did we do?

At first, we’ll check if the cache that was created still fits our needs or if it’s too old already. If the cache is just fine, we’ll skip to the output. If the cache is too old, we’ll pull the records once more from the database, store it into the array, cache the array and continue to the output.

Where do we go from here?

Well, at first you should eliminate the bottlenecks on your site. While phpCache comes in handy when you cache database queries and lookups, you shouldn’t use it as an excuse for your poor SQL skills. Whatever type of SQL you use, always debug (check the index, query speed, …). Depending on your type of SQL there might also be a thing called “Query Cache”, consult your manual and read up on it, if you are lucky to have it.

Maintainance?

phpCache comes with a neat little script called “gc.php”. It’s meant to clean up the cache it created. As the author put it, “Running this once a day is recommend.”. If you have questions about how to run PHP scripts with cron, check my
“Running PHP Scripts with Cron Tutorial”.

Feb 14 The Valentine Day Massacre Posted at 8:30 pm | 1 Comment »

Thanks to , a handful of “gentle readers” of the A List Apart website were invited to ranttalk about what they hate about “the web”. The article got the appropriate title, Valentine’s Day Massacre. And really - who would have expected it - the list is not too short, and I am glad to see that one is not alone with his opinion on certain topics and viewpoints.

Feb 11 firefox flicks Posted at 3:30 pm | No Comments »

If you feel creative, help out the people over at spreadfirefox with their Ad Contest. Fame (and maybe fortune) are waiting. :-)

Feb 11 Larry Mondry??? Posted at 1:37 pm | 1 Comment »

Over the past 3-4 years, I get mail at the HTMLCenter.com Post Office box for Larry Mondry. It shows him as the “Chief Oper” of HTMLCenter.com. So who is Larry Mondry?

(more…)

Feb 10 Homesite 5 Posted at 5:27 pm | No Comments »

I have been an avid fan of the HomeSite HTML editor since version 1.2. Back in those days, HomeSite was written and distributed by a single individual, Nick Bradbury. He created HomeSite when he got tired of using Notepad to create the HTML code for his online comic strip, “Dexter on the Net.” The product, even at these early stages, quickly became a favorite of HTML developers around the world. Before version 3 was completed, the software was sold to Allaire, which ended its days as a free product. However, it did not end HomeSite’s days as a viable tool, which all too often happens when a major corporation purchases software from private developers. In 2001, Allaire merged with Macromedia. HomeSite 5 is the first official Macromedia HomeSite release. How can the best HTML editor get better?

In HomeSite 4, there was one main issue that almost made me quit using the application. The main issue was the slow file tree. Using the Windows 2000 operating system, it normally would take between 7-12 seconds to show the files. Thankfully it seems that issue has been corrected in version 5.

The features that have been packed into HomeSite 5 are too numerous to list here. Here is a brief list of the key features:

Powerful Code Editing Tools

  • Tag Editors
  • Tag Insight and Tag Completion
  • Tag Inspector
  • Code Validator

Enhanced Productivity

  • Code Snippets
  • Integrated Workflow
  • ActionScripts
  • Wizards

Customizable Work Environment

  • Extensible User Interface
  • Configurable Workspace
  • Keyboard Shortcuts

Advanced File Management

  • Project Management
  • Secondary Files Tab
  • Scriptable Deployment
  • Auto Backup

Superior Code Navigation

  • Color Coding
  • Split Window
  • Collapsible Code

New file tabs

The second file tab addition is great. There are many times when I work in two different directories. The old method was to work within the file tree back and forth. This became irritating. Now, I can keep two folders open at the same time. The split window enables viewing of two areas of code simultaneously, allowing you to find coding errors easily while working with long blocks of code.

HomeSite 5 continues the tradition of including a complete and useful help system. Not only is the complete documentation for the software provided, but also a complete HTML reference guide and another reference guide regarding the use of style sheets. There is even a nice section on developing Dynamic Web Sites, something we hear more and more about these days and browsers get better and better. HomeSite 5 supports HTML’s multiple sets of standards from HTML2.0 -HTML4.0 and includes vast reference sections regarding both Internet Explorer and Netscape HTML extensions. These are fully documented and validated by the HTML validator on command.

It is also possible to configure multiple external browsers for easy viewing/testing of your websites on any browser platform. These can be used to view your pages even before you commit changes in the working documents to disk. The design window can also be split into two panes, one a code view and one a browser view so that you can instantly see the effects of code changes on the output document. This is a handy tool when making changes to a site and cuts down the amount of time the developer must spend switching between Homesite and an External browser or switching the Edit and Browse views within Homesite itself.

Overall, the merger between Macromedia and Allaire has made version 5 even better. Many of the problems or design oversights of previous versions have been totally eliminated. A handful of helpful new features have appeared. I am confident I will be using HomeSite 5 for all of my web development work.

Product Rating:

Company:
Macromedia

Requirements:
Windows 98, ME, NT, 2000 or XP

Pricing:
$99

Reviewed by:
Allen

Competition:
Ultraedit, Editpad, Webmaster PRO

Pros:
Two file tabs, integration with Dreamweaver

Cons:
Large icons, memory hog, menus can be confusing

Bottom Line:
Still the best text editor on the market.

Feb 10 HotDog 6.5 Posted at 5:25 pm | No Comments »

HotDog 6.5 is a powerful web development tool that targets both the experienced and novice user. Unlike the object oriented or “what you see is what you get” editors such as Dreamweaver and Frontpage, HotDog has its roots in text based HTML editing. Its native 32-bit code is streamlined to take 20% of the system resources and opens documents faster than previous versions. As an HTML editor, most of the code will have to be written manually, but there are time saving tools included to speed up the process.

HotDog is intuitive; however it may be initially overwhelming with all the features it offers. Once you’re acquainted with them, you’ll be wondering how you were able to work without them.

With all these features and tools at your disposal, the ability of HotDog to customize the program for ease and efficiency is a feature worth noting. Almost everything is customizable from automatic code completion, multiple levels of undo, dictionary types, syntax filter and macro editor. The toolbars are all dockable and the buttons on the toolbar can be re-arranged to your liking. It is also possible to drag and drop code, links, images or files onto the HTML editor by using shortcut features on the tool bars. Furthermore, you can customize the editing interface such as fonts and text colors, create your own tags and shortcut keys, specify a file to load each time HotDog is started, how often autosave occurs and more.

Some highlights of version 6.5 include features to teach you HTML with the property sheet, the mouseover tooltip help pops up when over a section of code, and the built in tutorials on top of the wizards and help dialogs. The help is unobtrusive, but can get in the way of the experienced user.

The ROVER is another great feature. It is an internal WYSIWYG viewer that allows you to see updates in real-time as you change the code. Link Sniffer will let you know if any links are pointing to bad or non-existing files or directories. You can even browse the whole site in a compact treeview through the HTML navigation view. Complex web sites are reduced to a more manageable hierarchical format.


You can spice up your web page not only with HTML code but also Javascript, CSS, ASP, and VBScript. The Supertoolz client allows unlimited downloadable plug-ins, some for a fee while others for free, to enhance HotDog’s capabilities. These Plug-ins include Java animations, JavaScript tools, image mapping, ICQ wizard, Xara 3d, SMIL composer, and Real Audio/Video Wizard just to name a few.

After you have completed your web page, you can proofread it with the multilingual spell checker or use the global search and replace features, which allows you to find many errors within your web page, including duplicate links. Optionally you can structure your pages so that images load faster. You also have the choice to publish to different operating systems such as Windows, Unix, or Mac/Amiga. Then the integrated ftp client manager will allow you to upload your work to a website. Should you need to make updates later on, you can also download the entire site with a click of a button.

There aren’t any templates for web pages, although it does let you create and save your own. The sound effects can get irritating after a while. Fortunately, they can be turned off. A free trial version is available from HotDog’s website.

Overall, HotDog 6.5 is an extremely powerful HTML editor which appeals to users of all skill levels. It has many strong features to increase productivity. The program is intuitive to use, yet keeps the power of a professional program at your fingertips. No project is too big or small for this dog to take a bite at.

Product Rating:

Company:
Sausage Software

Requirements:
Windows 95

Pricing:
$99

Reviewed by:
Edward Cheng

Competition:
Homesite 5.0, Ultraedit 6.10

Pros:
Intuitive application, fully customizable.

Cons:
Minor issues with Rover and bad sound effects

Bottom Line:
No project is too big or small for this dog to take a bite at.

Feb 9 GoLive 6 MAGIC Posted at 12:49 pm | No Comments »

When I spend a Saturday at a book store, I wonder why people spend money on these kinds of books. Everyone has seen the, “XYZ for Dummies” types; they are available for nearly every piece of software. So why do people purchase these types of books? I think it is because they are promoted as helpers, though they are quite difficult to work with. In general, I dislike these books.

I had never used Adobe’s GoLive before I got this book and it certainly got me hooked on the program.

GoLive 6 MAGIC

Buy from Amazon.com

The author of “GoLive6 MAGIC” is the infamous Paul Vachier. You might ask who is Paul Vachier. He has been actively involved in GoLive’s development at Adobe since the beginning. Vachier who had been a writer for a web-zine himself, worked at companies such as @home, Macromedia, Symantec and others, before he started working for Adobe on the GoLive team, where he has written lots of “actions” and the entire application’s documentation. Many of his “actions” are now part of the GoLive distribution.

The book is in fact made up of an entire team of authors. They all come from different computer-related backgrounds. Very skilled and talented people who have worked in the industry for some time and have gotten together to share their knowledge about and experiences with GoLive.

I believe New Riders (who are the publishers of this book) have a talent for chosing skilled authors. Or perhaps all the skilled people have their books publish at New Riders - who knows?

In any case, “GoLive 6 MAGIC” is different from other books. Do not expect the “We teach everything to do in 24 hours” attitude . “GoLive MAGIC” will take you beyond simple page editing. This is your seminar to become a GoLive MAGICIAN.

So what’s inside?

To begin, this book covers the topics you might expect it to. There are numerous pages on how to create basic HTML, CSS and DHTML. All very easy to comprehend and straight to the point. For example, topics covered include, CSS and the document object model, collapsible DHTML menus and a lot more.

What was surprising were the chapters about cHTML and i-mode. i-mode is the new mobile hype from Japan and a few mobile carriers are currently testing it in Europe as well. i-mode cellphones have a colordisplay and let you surf on websites with 48kbit/s - which is almost as fast as the speed of a standard modem. Fast enough to check stocks, news headlines or what movies are on at the theatre tonight - if you ask me.

Creating websites for i-mode is a pain. You have to follow certain standards (page width, height and so on, and so on), which is why I really welcomed that the book has a couple chapters about it. Thumbs up for that!

To continue riding the techie mobile train, there are also chapters on WAP - the Wireless Application Protocol. Another “wireless” thing (Yeah, duh!) and i-mode’s predecessor. Not too new, due to its lack of sucessfulness not important, but certainly nice to read up on it. Vachier’s tech editor made a typo when they said, “Wireless Access Protocol”, instead of “Wireless Application Protocol”. Read more on WAP.


And wait there’s more!

There is a chapter - which I had to read first - that explains how to create a small content management system (that is a set off scripts to manage the content of your website) with PHP and MySQL.

It is nice and easy to follow, specially for people who are new to all of this. When you have completed reading, you have the basics on how to get a installation of PHP and MySQL running, and how to set things up in GoLive. The CD included with the book provides you with the examples that they used in the book. Though it will not save you from learning more SQL-language, as a novice or intermediate individual, you are off to a very good start. If you are an advanced or professional user, this is old news to you.

I also found it quite interesting how they explain the terms - for example, middleware. Middleware comes up if you get into the dynamic content parts of the book. I disliked how Keniger absolutely does not mention any other type of SQL. There are at least a dozen different servers on the market and MySQL may be easy, but is by far not the best there is.

The remaining chapters cover Macros (very neat), Quicktime and GoLive’s very own site management tool, SDK, and a bunch more.

All “pro” and no “con”?

There is the “Index of Techniques”, which is too general in my opinion. For example, if you are looking for Flash, you have to read a chapter about Quicktime before you really get to it.

It might have helped if they had put down the actual page number the topic is covered on, and not the page number of the chapter it’s covered in. If you are like me, the index in the back of the book is what I go to for reference.

I definately recommend this book to those of you who have GoLive 6 and are struggling with it. If you own a copy already and did not know about two thirds of the things that I mentioned, go get it. It will help you.

If you are a “GoLive 6-Power User”, I think you are better off looking elsewhere. I recommend this book to novice and intermediate users.

Pro: Easy to read and understand. Great team of authors who have created a great set of tutorials walkthroughs!

Product Rating:

Company:
New Riders

Requirements:
N/A

Pricing:
$28.00

Reviewed by:
Till

Competition:
N/A

Pros:
Easy to read and understand. Great team of authors who have created a great set of tutorials and walkthroughs!

Cons:
The — Index of Techniques — It’s not the best book on the market for advanced users.

Bottom Line:
Diplomatical spoken: If you need it, it’s worth the money.

Feb 9 photoshop type effects Posted at 12:47 pm | No Comments »

Earlier this week, I received “photoshop type effects” from New Riders. The author of this book is Roger Pring who has been at the forefront of digital art since the 1980s.

When I scanned through the pages of the book, I immediately noticed that this was no run-of-the-mill type effects book. With dozens of type effects books on the market, I assumed this was going to be the same sort of book. Instead of the standard Table of Contents, “photoshop type effects” uses small thumbnails for their contents list. This allowed me to immediately jump to the effects that, to me, looked the most interesting.

photoshop type effects

Buy from Amazon.com

Each effect is demonstrated in clear, concise language. Generally, each effect is covered in two full color pages. There is a screen capture for each step in the effect and they are easy to follow along.

The book starts off with Reflective effects. Included in this section are: Polished Chrome, Bold As Brass, Good As Gold, Polished Metal and more.

Solid effects are next up, some of which are: Utterly Routed, Fret No More, Number Tile, etc. These effects are “Solid”.

Atmospheric effects are based on the earth. Sands of Time, Into The Fire, Absolute Zero, and Is It A Bird? are the demonstrated effects in this chapter.

Lighting effects light up the web with effects such as Red Hot, Light Information, Terminal Signboards, and Glow Baby Glow.

The next chapter covers Typographic effects which are more simplistic in nature. I like the Warped Type, Line Up and Mountain High.

The Simulations effects include All Keyed Up. This is one of the most effective effects I have ever seen. You can create some awesome Flash movies and animated gif files using this effect.


“photoshop type effects” also includes an Appendix which covers using Alien Skin Filters, 3rd-party effects and other 3rd-party filters. Pring explains how to use Photoshop shortcuts to save you time and effort for newbies.

My favorite five demonstrated effects are Polished Chrome, Good As Gold (the best gold effect I have seen), Number Tile, Terminal Signboards (makes me feel like I am at a ballpark), All Keyed Up and Beads. The book is created for use with Photoshop 7 but most effects should work with earlier versions. The author is not platform biased either; he shows screen grabs from the Macintosh and the PC Photoshop versions.

I would suggest this book for intermediate through advanced Photoshop users. The type effects move very quickly; I am not sure new users will be able to grasp some of the techniques. After trying most of the effects, my results did not look exactly the same as the book’s examples. This left me frustrated. At $45.00, it is a little pricey, but if you win over a client by using the techniques demonstrated, I am sure it will be well worth it.

Product Rating:

Company:
New Riders

Requirements:
N/A

Pricing:
45.00

Reviewed by:
Mindy

Competition:
N/A

Pros:
all new effects, demonstrated with Photoshop 7, step-by-step explanations

Cons:
high price, fonts demonstrated are not included making it hard to reproduce exactly what the author demonstrates

Bottom Line:
A worthwhile purchase for the intermediate to advanced Photoshop user.

Feb 3 Internet Explorer 7 Beta Posted at 8:06 am | 2 Comments »

This is a follow up on my last post about “Ajax” in Internet Explorer 7. Since then the beta came out and Allen felt gutsy and installed it. Checking our sites, it’s good to see that they all work and I hope there won’t be any other issues where we have to optimize for the browser. Not for HTMLCenter - and not in general.

(more…)

KickApps
Clicky Web Analytics

community discussion