BoukeWeening
Gebruiker
- Lid geworden
- 3 apr 2007
- Berichten
- 232
Wie kan mij helpen? Hoe krijg ik de uitkomst van de Radio button ook in de mail verwerkt?
Wie kan mij helpen? Hoe krijg ik de uitkomst van de Radio button ook in de mail verwerkt?
PHP:
// HTML e-mail formlier
echo '<form method="post" action="' . $_SERVER['REQUEST_URI'] . '" />
<p>
<label for="naam">Naam:</label>
<input type="text" class="input" id="naam" name="naam" value="' .htmlspecialchars($naam). '" /><br />
<label for="adres">Adres:</label>
<input type="text" class="input" id="adres" name="adres" value="' .htmlspecialchars($adres). '" /><br />
<label for="postcode">Postcode:</label>
<input type="text" class="input" id="postcode" name="postcode" value="' .htmlspecialchars($postcode). '" /><br />
<label for="Woonplaats">Woonplaats:</label>
<input type="text" class="input" id="woonplaats" name="woonplaats" value="' .htmlspecialchars($woonplaats). '" /><br />
<label for="mail">E-mailadres:</label>
<input type="text" class="input" id="mail" name="mail" value="' .htmlspecialchars($mail). '" /><br />
<label class="margin" for"bedrag">Bedrag:</label>
<input type="radio" id="bedrag" class="submit_formulier" value="3,16 euro p/m" name="bedrag">3,16 euro p/m<br />
<input type="radio" id="bedrag" class="submit_formulier" value="6,32 euro p/m" name="bedrag">6,32 euro p/m<br />
<input type="radio" id="bedrag" class="submit_formulier" value="vrij" name="bedrag"><input type="text" class="bedrag" "id="bedrag" name="bedrag" value="' .htmlspecialchars($bedrag). '" /> euro p/m<br /><br />
<label for="rekeningnummer">Rekeningnummer:</label>
<input type="text" class="input" id="rekeningnummer" name="rekeningnummer" value="' .htmlspecialchars($rekeningnummer). '" /><br />
<label for="bericht">Bericht:</label><br />
<textarea id="bericht" name="bericht" rows="4" style="width: 430px;">Typ hier eventueel uw bericht... ' .htmlspecialchars($bericht). '</textarea><br />
<input type="checkbox" name="machtiging" id="cfMachtiging" class="submit_formulier" value="Machtiging" /> Hierbij machtig ik Stichting Festival316 om het aangegeven bedrag af te schrijven van bovengenoemd bankrekeningnummer.</p>
<input type="submit" name="submit" value=" Versturen " />
</p>
</form>';
}
// versturen naar
else
{
// set datum
$datum = date('d/m/Y H:i:s');
$inhoud_mail = "===================================================\n";
$inhoud_mail .= "Ingevulde contact formulier " . $_SERVER['HTTP_HOST'] . "\n";
$inhoud_mail .= "===================================================\n\n";
$inhoud_mail .= "Naam: " . htmlspecialchars($_POST['naam']) . "\n";
$inhoud_mail .= "Adres: " . htmlspecialchars($_POST['adres']) . "\n";
$inhoud_mail .= "Postcode: " . htmlspecialchars($_POST['postcode']) . "\n";
$inhoud_mail .= "Woonplaats: " . htmlspecialchars($_POST['woonplaats']) . "\n";
$inhoud_mail .= "E-mail adres: " . htmlspecialchars($_POST['mail']) . "\n";
$inhoud_mail .= "Bedrag: " . htmlspecialchars($_POST['bedrag']) . "\n";
$inhoud_mail .= "Rekeningnummer: " . htmlspecialchars($_POST['rekeningnummer']) . "\n";
$inhoud_mail .= "E-mail adres: " . htmlspecialchars($_POST['mail']) . "\n";
$inhoud_mail .= "Bericht:\n";
$inhoud_mail .= htmlspecialchars($_POST['bericht']) . "\n\n";
$inhoud_mail .= "Verstuurd op " . $datum . " via het IP adres " . $_SERVER['REMOTE_ADDR'] . "\n\n";
$inhoud_mail .= "===================================================\n\n";
// --------------------
// spambot protectie
// ------
// van de tutorial: http://www.phphulp.nl/php/tutorial/beveiliging/spam-vrije-contact-formulieren/340/
// ------
$headers = 'From: ' . htmlspecialchars($_POST['naam']) . ' <' . $_POST['mail'] . '>';
$headers = stripslashes($headers);
$headers = str_replace('\n', '', $headers); // Verwijder \n
$headers = str_replace('\r', '', $headers); // Verwijder \r
$headers = str_replace("\"", "\\\"", str_replace("\\", "\\\\", $headers)); // Slashes van quotes
$_POST['onderwerp'] = str_replace('\n', '', $_POST['onderwerp']); // Verwijder \n
$_POST['onderwerp'] = str_replace('\r', '', $_POST['onderwerp']); // Verwijder \r
$_POST['onderwerp'] = str_replace("\"", "\\\"", str_replace("\\", "\\\\", $_POST['onderwerp'])); // Slashes van quotes
Wie kan mij helpen? Hoe krijg ik de uitkomst van de Radio button ook in de mail verwerkt?