.. here you can try:
http://www.tommyherrmanndesign.com/nof/html/kontakt.php
just tick checkbox (name of checkbox: "sendMail" (variable "$sendUser") with value "JA") "Kopie meiner Nachricht an mich senden" (you also may switch Google translator at the bottom of my page to English)
please be aware that I am a "newbie" with php but here is what I have changed in NOF file:
fh_formshandler.php
... important is to find out which position ($mzaehler) which CSV-field has (from left to right), i.e. lastname (variable $lastName) is position 2 and city (variable $city) is position 5 etc, etc, depending on the fields of your form.
I also display the information of the users name and city, date, time an so on at my "success page".
What I did is marked with // EDIT Thomas
... in my case CSV-field "sendMail" is the last field in my csv-file
Code:
// EDIT Thomas ANFANG //////////////////////////////////////////////////////////////////////////////
$firstName = preprocess($entryAppend); // = Feld Vorname //
} else {
$mzaehler++; // eigene Variable $mzaehler in der Schleife hochzählen //
$entry = $entry . "," . preprocess($entryAppend);
// EDIT Thomas ///////////////////////////////////////////////////////////////////////////////
if ($mzaehler == "2") { // wenn Feld 2 //
$lastName = preprocess($entryAppend); // = Feld Nachname //
}
if ($mzaehler == "5") { // wenn Feld 5 //
$city = preprocess($entryAppend); // = Feld Stadt //
}
if ($mzaehler == "8") { // wenn Feld 7 //
$mail = preprocess($entryAppend); // = Feld e-Mail //
}
if ($mzaehler == "9") { // wenn Feld 9 //
$comment = preprocess($entryAppend); // = Feld Kommentar //
}
if ($mzaehler == "10") { // wenn Feld 10 //
$reply = preprocess($entryAppend); // = Feld Auswahl //
}
$sendUser = preprocess($entryAppend); // = Feld sendMail //
// EDIT Thomas ENDE //////////////////////////////////////////////////////////////////////////
}
}
}
// EDIT Thomas Anfang - Variable Übergabe an Ausgabedatei //////////////////////////////////////////////////////
$timestamp = time(); // Variable gründen mit aktueller Zeit //
$datum = date("d.m.Y",$timestamp); // Variable gründen mit aktuellem Datum //
$uhrzeit = date("H:i",$timestamp); // Format festlegen //
$_SESSION['$datum'] = $datum; // Variable-Übergabe an Ausgabescript //
$_SESSION['$uhrzeit'] = $uhrzeit; // Variable-Übergabe an Ausgabescript //
$_SESSION['$firstNameK'] = str_replace( "\"", "", $firstName ); // Variable-Übergabe an Ausgabescript //
$_SESSION['$lastNameK'] = str_replace( "\"", "", $lastName ); // Variable-Übergabe an Ausgabescript //
$_SESSION['$cityK'] = str_replace( "\"", "", $city ); // Variable-Übergabe an Ausgabescript //
$_SESSION['$mailK'] = str_replace( "\"", "", $mail ); // Variable-Übergabe an Ausgabescript //
$_SESSION['$comment'] = str_replace( "\"", "", $comment ); // Variable-Übergabe an Ausgabescript //
$_SESSION['$reply'] = str_replace( "\"", "", $reply ); // Variable-Übergabe an Ausgabescript //
$_SESSION['$sendUser'] = str_replace( "\"", "", $sendUser ); // Variable-Übergabe an Ausgabescript //
$_SESSION['mkontakt'] = "Formular"; // Variable setzen für Ausgabescript //
$_SESSION['userkontakt'] = "Formular"; // Variable setzen für Ausgabescript //
// EDIT Thomas ENDE ////////////////////////////////////////////////////////////////////////////////////////////
I have set my "success page" of my forms handler component to "php" and have included this mail form (below, I have not changed my German text now). All SESSION variables have been declared in NOF file "fh_formshandler.php" in advance (see above)
Code:
<?php
// mail to sender
// e-mail Addres of sender
$sendAbs = $_SESSION['$mailK'];
// subject of e-Mail
$sendThema = "Kopie Deiner Nachricht an Thomas Frei-Herrmann wegen NOF";
// Text of e-Mail to sender
$sendUser = "Hallo,\r\n\r\n";
$sendUser .= $_SESSION['$firstNameK'] . " " . $_SESSION['$lastNameK'] . " aus " . $_SESSION['$cityK'] . ".\r\n\r\n\r\n";
$sendUser .= "Vielen Dank für Deine Nachricht. Ich werde so schnell wie möglich antworten.\r\n\r\n";
$sendUser .= "Du hast folgende Nachricht an mich gesendet:\r\n\r\n";
$sendSign = "\r\n\r\n\r\n\r\nGruss Thomas";
if ($_SESSION['$sendUser'] == "JA") { // IF User wants a copy of his mail and he ticked checkbox
//e-Mail senden an Absender
$mail_sent = @mail( $sendAbs, $sendThema, $sendUser . $sendComment . $sendSign, "From: mail@YourDomain.com");
echo $mail_sent ? "a copy has been sent:" : "Mail delivery failed:";
echo "<br><br>";
echo "<b>" . $sendAbs . "</b>";
}
?>
have fun