1. Computing

Website Accessibility

By

One of the great things about PHP is that it allows your website to react to the user. One way that you can utilize this is by tailoring your website to the needs of your user. I am speaking about site accessibility. When you design a website you want it to be used by as many people as possible, and making sure your site is accessible by all is a great start.

By accessible I am talking about two things. I mean both being usable by people accessing your site from different devices, as well as people who's needs for browsing the site differ.

Let's think about your website. Maybe you have a really fancy script font that you really like. It looks good and you can read it... but maybe its harder for someone with less than perfect vision to read. You should consider allowing your users to change the font, or the size of the font with a PHP script.

Don't disregard foreign visitors. Your information might be useful to people everywhere, but they can't read your content. You can also find many free ways to translate your website into peoples native languages. This is a great way to add world wide accessibility to your website.

Always remember to set your alt tags to useful things instead of key word stuffing. Most devices don't even need special software anymore to read websites to people with low vision. These tags will be read, so should actually describe what they are replacing.

In the old days we only had to worry about which browser people would be accessing our sites on, and make sure our features worked. Now people are accessing our sites not just from their computers but also on their phones, tablets and netbooks. I bet about half of my person web browsing happens from my iPad.

The good news in that case is that with PHP all of the actually scripting is done server side so it is compatible with any device you want to try. This isn't true for things that are executed on the client side. For example, none of the iPhones or iPads will play videos (or anything else) embedded with Flash, so you might consider using a different method to do this to make it accessible to these people.

Another thing to consider is size. Although your website may look great on a big HD display, how is it going to scale to someone reading it on a kindle fire, or even smaller... a phone? Since you are using PHP you can detect what a user is accessing your site from, and maybe give them a different layout accordingly. This will allow for a website that looks great across different devices. If you choose to do this make sure that you don't trap the user on the mobile version of your site. There is nothing worse than being forced to deal with a mobile site on an HD iPad that loads normal versions beautifully... always have a "view full site" link.

Also, make sure you are loading the same content with a different template. If I found your site by searching "Red Tubas" I don't want to be directed to your home page because I am on my phone, I want to view that red tuba page... only in a mobile version.

The bottom line is that we need to be considerate when creating our websites. Make sure your site is accessible by everyone, regardless of their individual needs or the device the used to find you. They want to read your site, and you want people to read your site. Everyone win with accessibility.

  1. About.com
  2. Computing
  3. PHP / MySQL
  4. Learn PHP
  5. Accessible Web Pages

©2014 About.com. All rights reserved.