|
 |
|
|
|
|
|
This is the complete script for php file all in one. Also have another with submition of file. File submition not working yet but impliminted in to script. Feel Free to download: All In One Email Form If some one else gets the attached file working in the number 2 file of the zip. Please let me know. Thanks Oh Yeah, you can test it here: Test Mail Form Here
| CODE | <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>All-In-One Feedback Form</title> </head> <body> <? $form_block = "<form method=\"Post\" Action=\"$_SERVER[PHP_SELF]\"> Please, Submit the following. Thank you for your time and interest.<br><br> <strong>Your Name:</strong><br> <INPUT TYPE=\"text\" NAME=\"sender_name\" VALUE=\"$_POST[sender_name]\" SIZE=30></p> <p><strong>Your Email:</strong><br> <INPUT TYPE=\"text\" NAME=\"sender_email\" VALUE=\"$_POST[sender_email]\" SIZE=30></p> <p><strong>Message:</strong><br> <TEXTAREA NAME=\"message\" COLS=30 ROWS=5 WRAP=virtual>$_POST[message] </TEXTAREA><br> <INPUT TYPE=\"hidden\" name=\"op\" value=\"ds\"> <p><INPUT TYPE=\"submit\" Name=\"submit\" VALUE=\"Submit\"></p> </form>"; if ($_POST[op] != "ds") { // They need to see the form echo "$form_block"; } else if ($_POST[op] == "ds") { if ($_POST[sender_name] == "") { $name_err = "<font color=red>Please enter your name!</font><br>"; $send = "no"; } //check value of user name if ($_POST[sender_email] == ""){ $email_err = "<font color=red>Please enter your e-mail address!</font><br>"; $send ="no"; } //check value of user email if ($_POST[message] == "") { $message_err = "<font color=red>Please enter a message!</font><br>"; $send = "no"; } //check value of message if ($send != "no") { // if all is filled in it's ok to send! $to = "casey@cowetaga.com"; $subject = "All-In_One Web Site feedback"; $mailheaders = "From: Swish Chat Site <> \n"; $mailheaders .= "Reply-To: $_POST[sender_email]\n\n"; $msg = "E-Mail Sent From: Swish Chat Site\n"; $msg .= "Sender's Name: $_POST[sender_name]\n"; $msg .= "Sender's E-Mail: $_POST[sender_email]\n"; $msg .= "Message: $_POST[message]\n\n"; mail($to, $subject, $msg, $mailheaders); echo "<p><center><h2>Mail has been sent!</h2></center></p>"; } //display confirmation to user else if ($send =="no"){ //print error messages echo "$name_err"; echo "$email_err"; echo "$message_err"; echo "$form_block"; }} ?> </body> </html>
|
|
|
|
|