Beste Leden,
Ik zit met het volgende probleem.
1. Ik krijg de foutmelding dat het bericht niet is ingevuld, ook al is hij dat wel.
2. Ik wil deel1 wel versturen als deel 2 niet is ingevuld.
Aanvullend bericht:Code:<?php if(!ctype_digit($_POST['telefoon'])) $telefoon_fout = 1; // E-mailadres van de ontvanger $mail_ontv = test@test.nl'; // <<<----- voer jouw e-mailadres hier in! $onderwerp = 'Contactformulier'; // Speciale checks voor naam en e-mailadres if ($_SERVER['REQUEST_METHOD'] == 'POST') { // naam controle if (empty($_POST['naam'])) $naam_fout = 1; // naam controle if (empty($_POST['naamprojectadres'])) $naamprojectadres_fout = 1; // naamproject controle if (empty($_POST['projectmail'])) $projectmail_fout = 1; // e-mailproject controle if (empty($_POST['projectadres'])) $projectadres_fout = 1; // projectadres controle if (empty($_POST['projectpostcode'])) $projectpostcode_fout = 1; // project postcode controle if (empty($_POST['projectplaats'])) $projectplaats_fout = 1; // projectplaats controle if (empty($_POST['woonplaats'])) $woonplaats_fout = 1; // plaats controle if (empty($_POST['telefoon'])) $telefoon_fout = 1; // telefoonnummer controle elseif(!empty($telefoon_fout)) echo 'Uw telefoonnummer mag alleen uit cijfers bestaan'; //adres controle if (empty($_POST['adres'])) $adres_fout = 1; // e-mail controle if (function_exists('filter_var') && !filter_var($_POST['mail'], FILTER_VALIDATE_EMAIL)) $email_fout = 1; // antiflood controle if (!empty($_SESSION['antiflood'])) { $seconde = 20; // 20 seconden voordat dezelfde persoon nog een keer een e-mail mag versturen $tijd = time() - $_SESSION['antiflood']; if($tijd < $seconde) $antiflood = 1; } } // Kijk of alle velden zijn ingevuld - naam mag alleen uit letters bestaan en het e-mailadres moet juist zijn if (($_SERVER['REQUEST_METHOD'] == 'POST' && (!empty($antiflood) || empty($_POST['naam']) || !empty($naam_fout) || empty($_POST['naamprojectadres']) || !empty($naamprojectadres) || empty($_POST['projectadres']) || !empty($projectadres) || empty($_POST['projecttelefoon']) || !empty($projecttelefoon) || empty($_POST['projectpostcode']) || !empty($projectpostcode) || empty($_POST['projectplaats']) || !empty($projectplaats) || empty($_POST['adres']) || !empty($adres_fout) || empty($_POST['postcode']) || !empty($postcode_fout) || empty($_POST['fax']) || !empty($fax_fout) || empty($_POST['telefoon']) || !empty($telefoon_fout) || empty($_POST['woonplaats']) || !empty($woonplaats_fout)|| empty($_POST['mail']) || !empty($email_fout) || empty($_POST['projectmail']) || !empty($projectmail_fout) || empty($_POST['bericht']) || empty($_POST['onderwerp']))) || $_SERVER['REQUEST_METHOD'] == 'GET') { if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (!empty($naam_fout)) echo '<p>Uw naam is niet ingevuld.</p>'; if (!empty($email_fout)) echo '<p>Uw e-mailadres is niet juist.</p>'; if (!empty($postcode_fout)) echo '<p>Uw postcode is niet juist.</p>'; if (!empty($fax_fout)) echo '<p>Uw faxnummer is niet juist.</p>'; if (!empty($naamprojectadres_fout)) echo '<p>Uw projectnaam is niet juist.</p>'; if (!empty($projectadres_fout)) echo '<p>Uw projectadres is niet juist.</p>'; if (!empty($projectpostcode_fout)) echo '<p>Uw project postcode is niet juist.</p>'; if (!empty($projectplaats_fout)) echo '<p>Uw project plaats is niet juist.</p>'; if (!empty($projectmail_fout)) echo '<p>Uw e-mailadres is niet juist.</p>'; if (!empty($telefoon_fout)) echo '<p>Uw telefoonnummer is niet juist.</p>'; if (!empty($projecttelefoon_fout)) echo '<p>Uw telefoonnummer is niet juist.</p>'; if (!empty($woonplaats_fout)) echo '<p>Uw woonplaats is niet juist.</p>'; if (!empty($adres_fout)) echo '<p>Uw adres is niet juist.</p>'; if (!empty($antiflood)) echo '<p>U mag slechts één bericht per ' . $seconde . ' seconde versturen.</p>'; else echo '<p>U bent het bericht vergeten in te vullen.</p>'; } // HTML e-mail formlier echo '<form method="post" action="' . $_SERVER['REQUEST_URI'] . '" /> <h1 class="red">Meld lekkage online</h1> <div class="clearfix"> <p><h2>Opdrachtgever</h2></p> <div class="w48 floatleft"> <label for="naamprojectadres">Naam projectadres:</label> <input type="text" class="w96" id="naamprojectadres" name="naamprojectadres" value="' . (isset($_POST['naamprojectadres']) ? htmlspecialchars($_POST['naamprojectadres']) : '') . '" /> </div> <div class="w48 floatright"> <label for="projectadres">Adres:</label> <input type="text" class="w96" id="projectadres" name="projectadres" value="' . (isset($_POST['projectadres']) ? htmlspecialchars($_POST['projectadres']) : '') . '" /> </div> <div class="w48 floatleft"> <label for="projectpostcode">Postcode:</label> <input type="text" class="w96" id="projectpostcode" name="projectpostcode" maxlength="6" value="' . (isset($_POST['projectpostcode']) ? htmlspecialchars($_POST['projectpostcode']) : '') . '" /> </div> <div class="w48 floatright"> <label for="projectplaats">Plaats:</label> <input type="text" class="w96" id="projectplaats" name="projectplaats" value="' . (isset($_POST['projectplaats']) ? htmlspecialchars($_POST['projectplaats']) : '') . '" /> </div> <div class="w48 floatleft"> <label for="mail">E-mailadres:</label> <input type="text" class="w96" id="projectmail" name="projectmail" value="' . (isset($_POST['proejctmail']) ? htmlspecialchars($_POST['projectmail']) : '') . '" /> </div> <div class="w48 floatright"> <label for="projecttelefoon">Telefoonnummer:</label> <input type="text" class="w96" id="projecttelefoon" name="projecttelefoon" maxlength="11" value="' . (isset($_POST['projecttelefoon']) ? htmlspecialchars($_POST['projecttelefoon']) : '') . '" /> </div> </div> <div class="w48 floatright"> <label for="fax">Fax:</label> <input type="text" class="w96" id="fax" name="fax" value="' . (isset($_POST['fax']) ? htmlspecialchars($_POST['fax']) : '') . '" /> </div> </div> <div class="w48"> <label for="bericht">Melding</label> <textarea id="bericht" name="bericht" class="w98" rows="6" cols="40" style="height: 80px;">' . (isset($_POST['bericht']) ? htmlspecialchars($_POST['bericht']) : '') . '</textarea> </div> <p><h3>Indien werkadres afwijkt van adres opdrachtgever</h3></p> <div class="w48 floatleft"> <label for="naam">Naam:</label> <input type="text" class="w96" id="naam" name="naam" value="' . (isset($_POST['naam']) ? htmlspecialchars($_POST['naam']) : '') . '" /> </div> <div class="w48 floatright"> <label for="adres">Adres:</label> <input type="text" class="w96" id="adres" name="adres" value="' . (isset($_POST['adres']) ? htmlspecialchars($_POST['adres']) : '') . '" /> </div> <div class="w48 floatleft"> <label for="postcode">Postcode:</label> <input type="text" class="w96" id="postcode" name="postcode" maxlength="6" value="' . (isset($_POST['postcode']) ? htmlspecialchars($_POST['postcode']) : '') . '" /> </div> <div class="w48 floatright"> <label for="woonplaats">Plaats:</label> <input type="text" class="w96" id="woonplaats" name="woonplaats" value="' . (isset($_POST['woonplaats']) ? htmlspecialchars($_POST['woonplaats']) : '') . '" /> </div> </div> <div class="w48 floatleft"> <label for="telefoon">Telefoonnummer:</label> <input type="text" class="w96" id="telefoon" name="telefoon" maxlength="11" value="' . (isset($_POST['telefoon']) ? htmlspecialchars($_POST['telefoon']) : '') . '" /> </div> </div> <div class="w48 floatright"> <label for="mail">E-mailadres:</label> <input type="text" class="w96" id="mail" name="mail" value="' . (isset($_POST['mail']) ? htmlspecialchars($_POST['mail']) : '') . '" /> </div> </div> <div class="clearfix"> <div class="w48 floatright"> <input type="hidden" id="onderwerp" name="onderwerp" value="Meld lekkage formulier" /><br /> </div> </div> </div> <div class="w48 floatright"> <div class="clearfix" style="margin-top: 15px;"> <input type="submit" name="submit" value=" Versturen " /> </div> </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\n"; $inhoud_mail .= "===================================================\n\n"; $inhoud_mail .= "<h2>Opdrachtgever:</h2>\n\n"; $inhoud_mail .= "Naam projectadres: " . htmlspecialchars($_POST['naamprojectadres']) . "\n"; $inhoud_mail .= "Adres: " . htmlspecialchars($_POST['projectadres']) . "\n"; $inhoud_mail .= "Postcode: " . htmlspecialchars($_POST['projectpostcode']) . "\n"; $inhoud_mail .= "Plaats: " . htmlspecialchars($_POST['projectplaats']) . "\n"; $inhoud_mail .= "E-mail: " . htmlspecialchars($_POST['projectmail']) . "\n"; $inhoud_mail .= "Telefoonnummer: " . htmlspecialchars($_POST['projecttelefoon']) . "\n"; $inhoud_mail .= "Fax: " . htmlspecialchars($_POST['fax']) . "\n\n"; $inhoud_mail .= "Bericht:\n\n"; $inhoud_mail .= htmlspecialchars($_POST['bericht']) . "\n\n\n"; $inhoud_mail .= "<h2>Opdachtgever:</h2>\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 .= "Telefoonnummer: " . htmlspecialchars($_POST['telefoon']) . "\n"; $inhoud_mail .= "E-mailadres: " . htmlspecialchars($_POST['mail']) . "\n"; $inhoud_mail .= "------------------------------------------------\n\n"; $inhoud_mail .= "Verstuurd op " . $datum . " via het IP adres " . $_SERVER['REMOTE_ADDR'] . "\n\n"; $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 if (mail($mail_ontv, $_POST['onderwerp'], $inhoud_mail, $headers)) { // zorg ervoor dat dezelfde persoon niet kan spammen $_SESSION['antiflood'] = time(); echo '<h1>Het contactformulier is verzonden</h1> <p>Bedankt voor het invullen van het contactformulier. We zullen zo spoedig mogelijk contact met u opnemen.</p>'; } else { echo '<h1>Het contactformulier is niet verzonden</h1> <p><b>Onze excuses.</b> Het contactformulier kon niet verzonden worden.</p>'; } } ?>
Kleine betaling mogelijk
- Melding niet ingevuld? PHP basic
-
08-06-2012, 14:27 #1
- Berichten
- 1.190
- Lid sinds
- 14 Jaar
Melding niet ingevuld? PHP basic
Laatst aangepast door Miichelle G : 08-06-2012 om 18:15 Reden: Automatisch samengevoegd.
-
In de schijnwerper
9 sites voor linkbuilding - geen reserveWebsite te koop[SNELLE LEVERING] Laat je website / webshop snel en professioneel bouwen!Freelance / WerkGezocht: Linkopties Installatie / Duurzaamheid / Groen / Energie / WonenOverige dealsSpraakcomputers.nl - Premium domeinnaam - Medisch / communicatiemiddelenDomein te koop -
08-06-2012, 21:05 #2
- Berichten
- 1.004
- Lid sinds
- 17 Jaar
Re: Melding niet ingevuld? PHP basic
PHP Code:<?php
if(!ctype_digit($_POST['telefoon'])) $telefoon_fout = 1;
// E-mailadres van de ontvanger
$mail_ontv = 'test@test.nl'; // <<<----- voer jouw e-mailadres hier in!
$onderwerp = 'Contactformulier';
// Speciale checks voor naam en e-mailadres
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
// naam controle
if (empty($_POST['naam']))
$naam_fout = 1;
// naam controle
if (empty($_POST['naamprojectadres']))
$naamprojectadres_fout = 1; // naamproject controle
if (empty($_POST['projectmail']))
$projectmail_fout = 1; // e-mailproject controle
if (empty($_POST['projectadres']))
$projectadres_fout = 1; // projectadres controle
if (empty($_POST['projectpostcode']))
$projectpostcode_fout = 1; // project postcode controle
if (empty($_POST['projectplaats']))
$projectplaats_fout = 1; // projectplaats controle
if (empty($_POST['woonplaats']))
$woonplaats_fout = 1; // plaats controle
if (empty($_POST['telefoon']))
$telefoon_fout = 1; // telefoonnummer controle
elseif(!empty($telefoon_fout)) echo 'Uw telefoonnummer mag alleen uit cijfers bestaan';
//adres controle
if (empty($_POST['adres']))
$adres_fout = 1;
// e-mail controle
if (function_exists('filter_var') && !filter_var($_POST['mail'], FILTER_VALIDATE_EMAIL))
$email_fout = 1;
// antiflood controle
if (!empty($_SESSION['antiflood']))
{
$seconde = 20; // 20 seconden voordat dezelfde persoon nog een keer een e-mail mag versturen
$tijd = time() - $_SESSION['antiflood'];
if($tijd < $seconde)
$antiflood = 1;
}
}
// Kijk of alle velden zijn ingevuld - naam mag alleen uit letters bestaan en het e-mailadres moet juist zijn
if (($_SERVER['REQUEST_METHOD'] == 'POST' && (!empty($antiflood) || empty($_POST['naam']) || !empty($naam_fout) || empty($_POST['naamprojectadres']) || !empty($naamprojectadres) || empty($_POST['projectadres']) || !empty($projectadres) || empty($_POST['projecttelefoon']) || !empty($projecttelefoon) || empty($_POST['projectpostcode']) || !empty($projectpostcode) || empty($_POST['projectplaats']) || !empty($projectplaats) || empty($_POST['adres']) || !empty($adres_fout) || empty($_POST['postcode']) || !empty($postcode_fout) || empty($_POST['fax']) || !empty($fax_fout) || empty($_POST['telefoon']) || !empty($telefoon_fout) || empty($_POST['woonplaats']) || !empty($woonplaats_fout)|| empty($_POST['mail']) || !empty($email_fout) || empty($_POST['projectmail']) || !empty($projectmail_fout) || empty($_POST['bericht']) || empty($_POST['onderwerp']))) || $_SERVER['REQUEST_METHOD'] == 'GET')
{
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
if (!empty($naam_fout))
echo '<p>Uw naam is niet ingevuld.</p>';
if (!empty($email_fout))
echo '<p>Uw e-mailadres is niet juist.</p>';
if (!empty($postcode_fout))
echo '<p>Uw postcode is niet juist.</p>';
if (!empty($fax_fout))
echo '<p>Uw faxnummer is niet juist.</p>';
if (!empty($naamprojectadres_fout))
echo '<p>Uw projectnaam is niet juist.</p>';
if (!empty($projectadres_fout))
echo '<p>Uw projectadres is niet juist.</p>';
if (!empty($projectpostcode_fout))
echo '<p>Uw project postcode is niet juist.</p>';
if (!empty($projectplaats_fout))
echo '<p>Uw project plaats is niet juist.</p>';
if (!empty($projectmail_fout))
echo '<p>Uw e-mailadres is niet juist.</p>';
if (!empty($telefoon_fout))
echo '<p>Uw telefoonnummer is niet juist.</p>';
if (!empty($projecttelefoon_fout))
echo '<p>Uw telefoonnummer is niet juist.</p>';
if (!empty($woonplaats_fout))
echo '<p>Uw woonplaats is niet juist.</p>';
if (!empty($adres_fout))
echo '<p>Uw adres is niet juist.</p>';
if (!empty($antiflood))
echo '<p>U mag slechts één bericht per ' . $seconde . ' seconde versturen.</p>';
else
echo '<p>U bent het bericht vergeten in te vullen.</p>';
}
// HTML e-mail formlier
echo '<form method="post" action="' . $_SERVER['REQUEST_URI'] . '" />
<h1 class="red">Meld lekkage online</h1>
<div class="clearfix">
<p><h2>Opdrachtgever</h2></p>
<div class="w48 floatleft">
<label for="naamprojectadres">Naam projectadres:</label>
<input type="text" class="w96" id="naamprojectadres" name="naamprojectadres" value="' . (isset($_POST['naamprojectadres']) ? htmlspecialchars($_POST['naamprojectadres']) : '') . '" />
</div>
<div class="w48 floatright">
<label for="projectadres">Adres:</label>
<input type="text" class="w96" id="projectadres" name="projectadres" value="' . (isset($_POST['projectadres']) ? htmlspecialchars($_POST['projectadres']) : '') . '" />
</div>
<div class="w48 floatleft">
<label for="projectpostcode">Postcode:</label>
<input type="text" class="w96" id="projectpostcode" name="projectpostcode" maxlength="6" value="' . (isset($_POST['projectpostcode']) ? htmlspecialchars($_POST['projectpostcode']) : '') . '" />
</div>
<div class="w48 floatright">
<label for="projectplaats">Plaats:</label>
<input type="text" class="w96" id="projectplaats" name="projectplaats" value="' . (isset($_POST['projectplaats']) ? htmlspecialchars($_POST['projectplaats']) : '') . '" />
</div>
<div class="w48 floatleft">
<label for="mail">E-mailadres:</label>
<input type="text" class="w96" id="projectmail" name="projectmail" value="' . (isset($_POST['proejctmail']) ? htmlspecialchars($_POST['projectmail']) : '') . '" />
</div>
<div class="w48 floatright">
<label for="projecttelefoon">Telefoonnummer:</label>
<input type="text" class="w96" id="projecttelefoon" name="projecttelefoon" maxlength="11" value="' . (isset($_POST['projecttelefoon']) ? htmlspecialchars($_POST['projecttelefoon']) : '') . '" />
</div>
</div>
<div class="w48 floatright">
<label for="fax">Fax:</label>
<input type="text" class="w96" id="fax" name="fax" value="' . (isset($_POST['fax']) ? htmlspecialchars($_POST['fax']) : '') . '" />
</div>
</div>
<div class="w48">
<label for="bericht">Melding</label>
<textarea id="bericht" name="bericht" class="w98" rows="6" cols="40" style="height: 80px;">' . (isset($_POST['bericht']) ? htmlspecialchars($_POST['bericht']) : '') . '</textarea>
</div>
<p><h3>Indien werkadres afwijkt van adres opdrachtgever</h3></p>
<div class="w48 floatleft">
<label for="naam">Naam:</label>
<input type="text" class="w96" id="naam" name="naam" value="' . (isset($_POST['naam']) ? htmlspecialchars($_POST['naam']) : '') . '" />
</div>
<div class="w48 floatright">
<label for="adres">Adres:</label>
<input type="text" class="w96" id="adres" name="adres" value="' . (isset($_POST['adres']) ? htmlspecialchars($_POST['adres']) : '') . '" />
</div>
<div class="w48 floatleft">
<label for="postcode">Postcode:</label>
<input type="text" class="w96" id="postcode" name="postcode" maxlength="6" value="' . (isset($_POST['postcode']) ? htmlspecialchars($_POST['postcode']) : '') . '" />
</div>
<div class="w48 floatright">
<label for="woonplaats">Plaats:</label>
<input type="text" class="w96" id="woonplaats" name="woonplaats" value="' . (isset($_POST['woonplaats']) ? htmlspecialchars($_POST['woonplaats']) : '') . '" />
</div>
</div>
<div class="w48 floatleft">
<label for="telefoon">Telefoonnummer:</label>
<input type="text" class="w96" id="telefoon" name="telefoon" maxlength="11" value="' . (isset($_POST['telefoon']) ? htmlspecialchars($_POST['telefoon']) : '') . '" />
</div>
</div>
<div class="w48 floatright">
<label for="mail">E-mailadres:</label>
<input type="text" class="w96" id="mail" name="mail" value="' . (isset($_POST['mail']) ? htmlspecialchars($_POST['mail']) : '') . '" />
</div>
</div>
<div class="clearfix">
<div class="w48 floatright">
<input type="hidden" id="onderwerp" name="onderwerp" value="Meld lekkage formulier" /><br />
</div>
</div>
</div>
<div class="w48 floatright">
<div class="clearfix" style="margin-top: 15px;">
<input type="submit" name="submit" value=" Versturen " />
</div>
</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\n";
$inhoud_mail .= "===================================================\n\n";
$inhoud_mail .= "<h2>Opdrachtgever:</h2>\n\n";
$inhoud_mail .= "Naam projectadres: " . htmlspecialchars($_POST['naamprojectadres']) . "\n";
$inhoud_mail .= "Adres: " . htmlspecialchars($_POST['projectadres']) . "\n";
$inhoud_mail .= "Postcode: " . htmlspecialchars($_POST['projectpostcode']) . "\n";
$inhoud_mail .= "Plaats: " . htmlspecialchars($_POST['projectplaats']) . "\n";
$inhoud_mail .= "E-mail: " . htmlspecialchars($_POST['projectmail']) . "\n";
$inhoud_mail .= "Telefoonnummer: " . htmlspecialchars($_POST['projecttelefoon']) . "\n";
$inhoud_mail .= "Fax: " . htmlspecialchars($_POST['fax']) . "\n\n";
$inhoud_mail .= "Bericht:\n\n";
$inhoud_mail .= htmlspecialchars($_POST['bericht']) . "\n\n\n";
$inhoud_mail .= "<h2>Opdachtgever:</h2>\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 .= "Telefoonnummer: " . htmlspecialchars($_POST['telefoon']) . "\n";
$inhoud_mail .= "E-mailadres: " . htmlspecialchars($_POST['mail']) . "\n";
$inhoud_mail .= "------------------------------------------------\n\n";
$inhoud_mail .= "Verstuurd op " . $datum . " via het IP adres " . $_SERVER['REMOTE_ADDR'] . "\n\n";
$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
if (mail($mail_ontv, $_POST['onderwerp'], $inhoud_mail, $headers))
{
// zorg ervoor dat dezelfde persoon niet kan spammen
$_SESSION['antiflood'] = time();
echo '<h1>Het contactformulier is verzonden</h1>
<p>Bedankt voor het invullen van het contactformulier. We zullen zo spoedig mogelijk contact met u opnemen.</p>';
}
else
{
echo '<h1>Het contactformulier is niet verzonden</h1>
<p><b>Onze excuses.</b> Het contactformulier kon niet verzonden worden.</p>';
}
}
?>
Plaats een
- + Advertentie
- + Onderwerp
Marktplaats
Webmasterforum
- Websites algemeen
- Sitechecks
- Marketing
- Domeinen algemeen
- Waardebepaling
- CMS
- Wordpress
- Joomla
- Magento
- Google algemeen
- SEO
- Analytics
- Adsense
- Adwords
- HTML / XHTML
- CSS
- Programmeren
- PHP
- Javascript
- JQuery
- MySQL
- Ondernemen algemeen
- Belastingen
- Juridisch
- Grafisch ontwerp
- Hosting Algemeen
- Hardware Info
- Offtopic