1) is it a job for us to bid? heheh
2) you asking for help with your code? or you asking for someone do it for you?
2a) if asking for help with ur code, which section of ur code got problems?
2b) if asking for someone do it for u, see (1)
if 2a) i suggest instead of copying a brunch of codes from the book and cross ur finger, lets do little by little at a time. i.e: 1) build form 2) build validation for the form 3) build object(s) that talks to ur database 4) build object(s) sends email 5) setup login to see when to send email, when to send to db or both.
puting everything into little pieces of block will be easier to work with.