Complete PHP mail form - PHP / MySQL Tutorials
 
  Buy Ebooks, Video Games, DVDs, Electronics and more !
Home | Help Forums | Web Design Tutorials | Free Swishmax Downloads Make Money Online Blog . Free Image and Photo Sharing and Hosting

 

 

Company

Home

Nework Details

Tutorials

SWiSH 2

SWiSHMax

Flash MX

PHP & MySQL

HTML / JScript

Adobe Photoshop

Corel Draw

Gimp

Miscellaneous

Downloads

Templates

Plugins

Fonts

Wallpapers

Free Images

Scripts and Codes

Products

E-Books

SWiSH BB

SWiSH Templates

SWiSH-DB Newsletter
Subscribe to our newsletter : GO
  Partners / Affiliates

   Free image hosting
   Web Design Pakistan
   Swish Templates
   SWiSH Climax
   Talkfreelance Community
   Template Desire
   Lite boards
   Script Sector
   GimpTalk
   13dots
   Idea Designs
   PHP Cafe
   Sposatoettore
   Free swishmax templates
   Swishzone

Manage your site with Flax Article Content Management System
Complete PHP mail form
Category : PHP / MySQL | Level : Intermediate | Language : English
Ask Question | Read Comments | Post tutorial | Previous | Next

Web www.swish-db.com

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 biggrin.gif
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 wink.gif

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>



© 2002-2005 Flaxweb Network | Article Manager | Gimp Tutorials Library | RAD C++ Library | Free C/C++ Sourcecode |
Sites of interest : Web Design Blog | Swish Templates | Swishmax Ebook | Photoshop Templates | Gimp Tutorials | Text Forum | Make Money Online