The only Comment I will make to Monie's code is not to use reserved names like "name" but rather use something like "vName", I always use v's in front of variables to clearly denote them.
Have a look at this page for a list of reserved names -
http://www.webthang.co.uk/tuts/tuts_...rds/rwords.asp
Hope this helps.
