easy mail php project

2
 <html> <head> <title>EEE zy Fee dback Form V 1.2</title> </head> <body> <? $form_block = " <form method=\"post\" action=\"$PHP_SE LF\"> <p><strong>Your name:</strong><br> <input type =\"text\" name=\"name\" size= 30 value=\"$_POST[name ]\"</p> <p><strong>Your email:</strong><br> <input type=\"text\" name=\"email\" value=\"$_POST[email]\"size=30</p> <p><strong>Comments:</strong><br> <textarea name=\"comments\" cols=30 rows=5 wrap=virtual>$_POST[comments]</textarea></p> <input type=\"hi dden\" name=\"op\" value=\"d s\"> <p> <input type=\"submi t\" name=\" submit\" value =\ "Send F orm\"></p> <br> <a href=\"http://www.naf wa.org/\">< font s ize=\"1\"> <b>Powered By The Nutriti on and Food Web Archive </b></font> </form>"; if ($_POST[op] != "ds") { echo "$form_block"; } else i f ($_POS T[op] == "ds") { if ($_POST[name] == "") { $name_err = "<font color=blue >Please enter your name!</font>< br>"; $send="no"; } if ($_POST[email ] == "") { $email_err = "<font color=blue>Please enter your email !</font><br>"; $send="no"; } if ($_POST[comments] == "") { $message_err = "<font color=blue >Please enter a comment!</fo nt>< br>"; $send="no";

Upload: zeroxcool4968

Post on 07-Oct-2015

9 views

Category:

Documents


0 download

DESCRIPTION

Easy Mail Php Project

TRANSCRIPT

  • EEEzy Feedback Form V 1.2

  • }

    if ($send !="no") {

    $msg = "email sent from mywebsite.com\n";

    $msg .="Name: $_POST[name]\n";

    $msg .="Email: $_POST[email]\n";

    $msg .="Comments: $_POST[comments]\n";

    $to = "[email protected]";

    $subject = "Feedback Form";

    $mailheaders = "From: My Website \n";

    $mailheaders .= "Reply-To: $_POST[email]\n";

    mail ($to, $subject, $msg, $mailheaders);

    echo "Mail has been sent!";

    } else if ($send == "no") {

    echo "$name_err";

    echo "$email_err";

    echo "$message_err";

    echo "$form_block";

    }

    }

    ?>