In HTML non si può fare. Devi utilizzare un linguaggio lato server come ASP o PHP.