I have two forms, one the first, is a comments form that submits to the database and then I want it to mail the form variables to my clients email. What I have done so far is this...
I have created an insert statement that inserts all of the variables on submit to the database, no problem. I then have created a simple mailing script which captures thevariables and sends them via email in an html encoded page to the clients email. I have placed a require statement in my comments page that calls the email script. The problem I am running into is this.
When the comments form opens on the web site or is loaded, the email script runs and mails a blank form to my client. I somehow need to code a function that allows the mail script to look at the form and basically validate it saying if it is empty or on-load do nothing, then execute when the insert statement has been called or on submit is executed.
I have also tried placing the raw code from the mail script below the comments form insert statement and still is executing before there is anything in the form feilds.
A bit if help would be greatly appreciated.
Thanks to the forum for any help ahead of time.
I have attached my comments1.php script for review
The site and page is located here http://doublz.com/comments1.php
JM