Forum Moderators: phranque
You can do it client-side with javascript or server-side with the scripting language of your choice. Or both.
Doing it client-side with javascript doesn't work if the user has javascript disabled, of course, so either server-side or both is the better option if the restriction really matters.