Category: Tutorials

Fixing the “Invalid Token” error for Joomla contact forms

I recently noticed that sometimes the Joomla core contact form will give an “Invalid Token” error page when a website visitor uses the contact form to send a message to the owner of the website.  This screen is unmistakable, and somewhat shocking to the unsuspecting website visitor, as it is completely blank except for the words “Invalid Token” in the upper-left corner of the browser window.

What also happens, and this is the really frustrating part, is that their message does not make it to its intended recipient, the sender of the message probably won’t try again, and it makes you and your website look rather incompetent.  What’s also frustrating is that you may not know your website is doing this unless you try your own submission form several times in a row.

I discovered the problem by checking the Moovur/Mollom log of one website we’ve built.  This log keeps track of all contact form submissions, both spam and ham.  What’s recorded is the date, the name, email address, message subject, and a brief excerpt from the message.  What clued me in is that there were messages listed in that log that the owner of the website had not received.  (How did I know they hadn’t been received?  I happen to know the website owner very well – she’s my wife!)

Here’s how to fix it…


Managing your WordPress post revisions

If you’re using a self-hosted version of WordPress you may have noticed that WordPress is keeping copies of every post revision you make.  While this can be helpful in rolling a post back to an earlier version, the number of revisions can quickly get out of hand.  These revisions are stored in your database, and once a post is published you probably don’t need them anymore.  There are a few plugins that can help you manage these revisions, but in my opinion, if you can do this without adding another plugin, so much the better.

There’s a lot of information on the web about this topic, and I filtered through it recently and came up with this solution.


Creating a custom Joomla 404 error page

Default Joomla 404 error pageLet’s face it: the default Joomla 404 error page, while useful and perhaps necessary, is one of the uglier web pages in existence.  The shock value of seeing one of these pages for the first time is memorable, and diminishes only slowly over time.

Creating a custom 404 error page for your Joomla website isn’t all that difficult, though there are several different approaches to making it work, and this blog post explains the process I’m using on this website and a few others I’ve built.  I should also add that inspiration for this method came from this lengthy thread on the Joomla forums.

Creating a custom Joomla 404 error page – the process

Custom Joomla 404 error pageThe image to the left is a screenshot of the custom 404 error page I came up with, and you can see a full-size version of the page by clicking on the image.

For more ideas and to see what other web designers have come up with, Smashing Magazine has put together a collection of some of the best 404 pages on the web, with links to some other collections as well.

If you’re going to be making these changes to a ‘live’ site, then I recommend that you make them in roughly the following order.  Also, as a general rule-of-thumb, make a backup of your website before making any significant changes.


Setting your Joomla or WordPress website’s copyright date to update itself every year

2010 is now one week old. Have you updated the copyright date in your website(s) yet?

When I was updating the copyright date in our website and our clients’ websites this week it occurred to me that there should be a way for the date to be updated automatically, and there is IF your website is dynamic and uses PHP like Joomla or WordPress does.

While implementing these changes I encountered three different ways various Joomla templates (and a WordPress theme) handle the copyright information.  There are probably more possibilities, but the basic coding principle is going to apply in each situation, so you may need to put some thought into making this work if your website is set-up differently than one of the three options I’m going to describe.

Also, this tutorial is exactly that, a tutorial. In no way should this information be construed as legal advice in any form.  I’d also recommend making a fresh backup of your website (files and database) before making any significant changes.  Having said that, here’s how to do it.