Storing Passwords - The Wrong, Better and Even Better Way

21 Jun 2009
If you've ever had to sign up to use a website, you'll no doubt have been prompted to provide a username and password, so that when you next visit the site you can login without having to fill in all of your details again. Your password has to be stored somewhere, otherwise you won't be able to login the next time you visit. Right? Unfortunately, a few sites I've come across do just this. They store your password, which means if the information is stolen, someone has got your password.

In a perfect world, everyone would use a different password for every account they sign up for, and that password would be a combination of numbers, letters (uppercase and lowercase) and special characters, and would be at least about 20 characters long. But let's be honest here, we're not all memory machines and remembering cryptic combinations like that isn't something everyone can do. So people are tempted to choose just one password and use it on everything they sign up for, including their email account. Which means there's the potential for someone to have the email address and the password. Not a very good thing.

There's no way around this, the weakest point in any security system is the human element. People are always going to chose easy passwords, or use the same passwords for multiple sites. So it's up to us as web developers to help to keep the passwords secure so that these people never have to go through the problems associated with someone getting into their other accounts.

This all comes down to how you store the password. Do you do it the “Wrong Way”, the “Better Way” or the “Even Better Way”? (I'm not going to say the “Right Way”, because I don't think there is such a thing when it comes to password security). Read More...

Always Include a Print Stylesheet

29 Apr 2009
Earlier today I added a new tip to Tipster entitled Use a Print Stylesheet. I thought I'd follow it up here in a bit more detail.

A print stylesheet is a stylesheet that's only applied to your website when the user goes to print it. A lot of sites will provide a "print version" of their page, which is a page which has the same content as the original page, but has different markup and layout to make it look better when printed. But creating a separate "print version" of your page is not necessary, as you can simply use a print stylesheet to do all of the work.

Most websites have a lot of content which is very useful when browsing the site, but makes no sense being printed out on paper. Navigation menus for example are great for getting around a site, but are a waste of ink and paper if it gets printed every time a user prints a page from your site. You also don't really want background colours to be printed, as if your site has a dark background it's going to waste a lot of ink.

The internet and paper are two completely different types of media, and your site should adjust so that it's best suited for the media it is being presented on. While small fonts may look fine on a screen, they may be very difficult to read when printed. Banner images may make your website stand out from the rest, but it's just going to waste paper if it gets printed. Now I could go down the green route here and say that having a print stylesheet helps to save the environment. Less ink equals less paper, and not wasting paper is good for the environment. For most people this would be more than enough to encourage them to use a print stylesheet. But for the more business minded, print stylesheets take time to develop, and is it really worth the extra cost? Well the answer is yes. Read More...

Reorganisation

26 Apr 2009
I've finally started to re-build this site. I can't even remember the last time I had chance to just sit down and play with the code for it. After taking one look at the PHP, I decided it really wasn't worth the hassle to try and fix it. I originally wrote the code for this site back when I first learnt PHP and it was not a pretty sight. I couldn't believe some of the code, I want to believe I could never write such horrible code, but well.. I was learning, so you can't really blame me.

So I have re-built the entire back-end of this site using a lovely object oriented approach and I've restructured the entire database so that it's a little quicker on the lookups. I've also taken the opportunity to re-write some of the markup for the front-end, although I'm still in the process of sorting that out. I also updated the Flux style (I've called this new version "Flux Refresh", since it's pretty much the same style, just with a slightly more polished look). I intend to create an entirely new style for the site sometime soon, but that's a job for another day.

My next task is to organise the content of the site. I have many more projects to add, and perhaps some new sections to add. I'm also in the process of re-building my photos section, which will be back up and available sometime soon. As part of this process I'm also going to try and actually write some more posts for the site. I already have a few drafted out which I'll put up soon, but it would be nice to actually get some content added every now and then rather than me just being too lazy to update as has been in the past.

In a bold move, I've also dropped IE6 support. I'm sick and tired of having to deal with such a completely useless browser. So you now get a non-styled version of the site if you use IE6. If you don't like it, tough! We don't like your kind around these parts!

digg2del.icio.us

24 Feb 2009
I was trying to find a tool the other day, which would take all of the stories I've "dugg" over on digg.com, and add them as bookmarks to my del.icio.us account. Unfortunately, my search didn't turn up anything, so I decided to make one myself.

It's just one PHP file which you can use to export the digg stories for your username (or any username on Digg for that matter), and import them into your del.icio.us account.

digg2delicious-1.0.tar.gz - 5.0KB

Alternatively, you can just try it out without downloading the file yourself.

Chrome Beta Released

02 Sep 2008
Google's new browser, Chrome, is now available for download on Windows XP/Vista only.

First impressions are that it's a very fast install, and imported all of my Firefox bookmarks with no issues. Loads much quicker than any of my other browsers, and looks quite nice. The address bar is a bit thick for my liking, but that's just me being picky. None of the usual "File", "Edit" menus, etc as the entire interface is pretty simplistic. Exactly what we've come to expect from Google products. It's got the usual Google feel about it, a nice clean interface, no status bar showing useless information, etc. When the status bar does show, you can move your mouse towards it, and it'll drop below the window so it's not in the way of the page. A nice touch.

Some things are noticeably missing though, such as a "home" button, which is a feature common to most browsers. It is available, but not enabled by default. It's an option on the "Basics" part of the options page. I guess it depends on how much you use it whether that will be an annoyance or a blessing.

Sites are loading pretty fast, as I would expect from something based on WebKit. One feature I have noticed, is that when you're on a page with a download link, it gives you a list of the available downloads at the bottom of the page. I've already found this useful.

They've taken a page from IE8, and fade out the rest of the URL that's not the main domain. I'm not really sure why this is becoming common, and I don't really see the point. Regarding the address bar though, it's also a search bar. You can either enter a URL, or a search term and it will search Google. This combines the two bars you get in Firefox quite nicely. Of course, in FF you can choose the dropdown for various sites (for example I have a Wikipedia one), and I haven't found a way to do that easily in Chrome yet.

Next up are the screenshots. Read More...

Twitter