farlo lato server "è meglio", ma puoi utilizzare anche js
http://www.html.it/articoli/larte-de...e-i-browser-1/