Entries from 2012

Typing URLs into the Google Search Box

Have you received a message from a customer asking why a website address provided doesn't work? Maybe the address worked just fine when it was initially sent via e-mail, but upon returning at a later date, the page could no longer be found. Well, it may be more than a mistyped address or an Internet connection issue. [Continue reading]

Keeping Code Up-to-Date

When managing websites, keep in mind that the Internet doesn't sit still. That PHP script written 10 years ago probably has a thing or two needing to be updated. There may be security issues, outdated code, etc. In addition to the evolution of programming / scripting languages, you as a developer have likely changed. Your coding practices are likely to be more efficient and more secure. So let's look at why we need to review old scripts on a semi-regular basis. [Continue reading]

Why PHP_SELF Should Be Avoided When Creating Website Links

When looking for articles about PHP_SELF, it seems like most only refer to the dangers of using the variable with HTML forms. However, there are risks with using it in other parts of a website. For example, it may be tempting to use the variable within the href attribute for links. The problem is that those links become susceptible to Cross-Site Scripting (XSS). Let's take a closer look at the security vulnerability of PHP_SELF and a simple alternative to avoid the problem altogether. [Continue reading]

How to Disable (or Modify) the Revision History in WordPress

For some reason, WordPress maintains the revision history for posts in the same database as the live posts. The issue with having the revision posts in the database is the extra overhead. Whenever the website queries the database, it needs to work with all records—including the revisions. Of course, this will unlikely be a problem for most blogs. But for those who prefer to keep websites running as efficiently as possible, the number of revisions can be limited…or stopped altogether. [Continue reading]

Using Google Analytics to Determine Which Browsers Are Used Most for Accessing Your Website

When designing websites, it's important to have a general idea of which browsers your audience prefers. Knowing this helps identify which browsers to use for testing your website. Some coding solutions may also need to be altered. For example, if 60% of visitors are still using Internet Explorer 6, you might need to rethink some of those fancy CSS techniques. So let's look into utilizing Google Analytics to figure out which browsers are being used. [Continue reading]

Making HTML Forms More Accessible and Improving Usability with the Label Tag

It's surprising that there are still HTML forms online not taking advantage of the <label> tag. In addition to being required for creating accessible forms, <label> tags improve the usability of forms. For example, instead of forcing visitors to click those tiny radio buttons, why not let them to click the text label. [Continue reading]

Generate Usernames with JavaScript: Working with Short Last Names

When generating usernames, one thing to consider is the length of the username. The code from last week's post may be problematic if you're looking for the username to be five characters or more and the user's last name is only two characters. After tacking on the first initial, you would only have three characters. So let's look at getting closer to the desired results. [Continue reading]

Using JavaScript to Dynamically Generate the Username within an HTML Form

Usernames are typically made up of some combination of the user's first and last name. If that's the case, the form used to create those usernames could be modified to take advantage of the data in the first and last name fields. Instead of making someone manually type the username, JavaScript could be employed to generate it automatically. [Continue reading]

Using Internet Explorer 9 to Test Websites with IE8 and IE7

Did you know that Internet Explorer 9 (IE9) provides the capability for viewing websites in IE8 and IE7? There's no need to install an add-on or download anything from a browser archive. The power to test websites using all three versions of Internet Explorer is built in. Of course, the feature for switching between the different options is a little buried. [Continue reading]

Using the Date Format Chosen by the User Instead of Hard-Coding Your Own in the WordPress Theme

WordPress has a setting under the admin panel where blog owners can indicate how dates should be displayed for blog posts and comments made to the blog. The setting isn't very useful though when the date format is hard coded into the theme. Instead of making users edit the theme files, let's take advantage of the WordPress setting. [Continue reading]