Hi fellow server side scripters

I'm very new to PHP and am working on creating a form that uses PHP.

Basically what i'm hoping to do is:
  • Check if the submit button has been pressed or not.
  • Check that a valid email address format has been entered.
  • If the submit button has not been pressed (ie. it's the first visit to the page) then produce the form fields.
  • If the form has been filled out and the page submitted, populate the appropriate areas with the details submitted.
  • Once all details have been verified as correct, submit the info again, but this time the script emails myself with the info and also emails the $email with the similar info but an extra paragraph or two and also reload the page with the submitted details, plus a thank you note.

My questions are:
  • I should do this all on the same page or not?
  • How do I differenciate between the first submit button and the second one?
  • How should I setup the script to send 2 different emails to me and the person that filled out the form?

If there is anything else you feel I should do with this script please post it here.

I hope I explained myself clearly and concisely

rgds,