Hi all!
Haven't been online in a while. But im back
I have a question: I want to add a phpcontact to my webpage. I already got the code from my teachter i know how to edit it and stuff, but how do i add to my css/html page?
Here is the code
<?
// geef e-mail adres op van ontvanger
//$mail_ontv = "info@instituutmenz.nl";
$mail_ontv = "info@instituutmenz.nl";
// als er niet op submit is gedrukt, of als er wel op is gedrukt maar niet alles ingevoerd is
if (!$_POST['submit'] || $_POST['submit'] && (!$_POST['voornaam'] || !$_POST['achternaam'] || !$_POST['telefoon']))
{
if (!$_POST['submit'] || $_POST['submit'] && (!$_POST['voornaam'] || !$_POST['achternaam'] || !$_POST['telefoon']))
{
// echo "<p class='font_content_info'><b>Vul alle verplichte velden in.</b><p>";
}
// form + tabel
echo "<table border='0' cellspacing='0' cellpadding='0' width='400px;' style='margin-left:30px'>";
echo "<form method=\"POST\"\">";
// optie
// echo "<tr><td colspan='2' class='font_content_info'><input type='checkbox' name='optie' value='optie nemen'>Optie nemen</td></tr>";
// aanmelden
// echo "<tr><td colspan='2' class='font_content_info' ><input type='checkbox' name='optie' value='aanmelden'>Aanmelden</td></tr>";
// space
//echo "<tr><td colspan='2'> </td></tr>";
//selectie
/* echo "<tr><td class='font_content_info' colspan='2'>
<select name='list' style='width:400px;'>
<option value='opleiding A'>informatieavond</option>
<option value='opleiding B'>nlp basistraining</option>
<option value='opleiding C'>nlp practitioner opleiding</option>
<option value='opleiding D'>nlp master practitioner opleiding</option>
<option value='opleiding E'>jongerentraining</option>
</select>
</td></tr>";
*/
// naam
echo "<tr>
<td class='font_content_info' style='width:100px'>Vooraam:</td>
<td class='font_content_info' style='width:100px'>Achternaam:</td>
</tr>";
echo "<tr><td class='font_content_info'>
<input style='width:200px;' type=\"text\" class=\"Inputopmaak\" name=\"voornaam\" value=\"" . $_POST['voornaam'] . "\">*</td><td class='font_content_info'>
<input style='width:180px;' type=\"text\" class=\"Inputopmaak\" name=\"achternaam\" value=\"" . $_POST['achternaam'] . "\">*</td></tr>";
// mail
echo "<tr><td class='font_content_info'>E-mail adres:</td></tr>";
echo "<tr><td class='font_content_info' colspan='2'><input type=\"text\" class=\"Inputopmaak\" style='width:397px' name=\"mail\" value=\"" . $_POST['mail'] . "\">*</td></tr>";
// onderwerp
echo "<tr><td class='font_content_info'>Telefoonnummer:</td></tr>";
echo "<tr><td class='font_content_info' colspan='2'><input type=\"text\" class=\"Inputopmaak\" name=\"telefoon\" style='width:397px' value=\"" . $_POST['telefoon'] . "\">*</td></tr>";
/* echo "<tr>
<td class='font_content_info'>Straat:</td>
<td class='font_content_info'>NR:</td>
</tr>";
echo "<tr><td class='font_content_info'>
<input style='width:200px;' type=\"text\" class=\"Inputopmaak\" name=\"straat\" value=\"" . $_POST['straat'] . "\"></td><td class='font_content_info'>
<input style='width:180px;' type=\"text\" class=\"Inputopmaak\" name=\"nrl\" value=\"" . $_POST['nrl'] . "\"></td></tr>";
echo "<tr>
<td class='font_content_info' style='width:40%'>Postcode:</td>
<td class='font_content_info' style='width:40%'>Plaats:</td>
</tr>";
echo "<tr><td class='font_content_info'>
<input style='width:200px;' type=\"text\" class=\"Inputopmaak\" name=\"postcode\" value=\"" . $_POST['postcode'] . "\"></td><td class='font_content_info'>
<input style='width:180px;' type=\"text\" class=\"Inputopmaak\" name=\"plaats\" value=\"" . $_POST['plaats'] . "\"></td></tr>";
*/
// space
echo "<tr><td colspan='2'> </td></tr>";
// mail
echo "<tr><td class='font_content_info'>Opmerkingen:</td></tr>";
echo "<tr><td colspan='2'><TEXTAREA name=\"msggs\" class=\"Inputopmaak\" ROWS=\"6\" COLS=\"48\" >" . htmlentities($_POST['msggs']) . "</TEXTAREA></td></tr>";
// button
echo "<tr><td> </td></tr>";
echo "<tr><td ><input type=\"submit\" class=\"InputopmaakSubmit\" name=\"submit\" value=\"Versturen\"></td></tr>";
// sluit form + tabel
echo "</form>";
echo "</table>";
}
// versturen naar
// versturen naar
else
{
// set datum
$datum = date("d.m.Y H:i");
// set ip
$ip = $_SERVER['REMOTE_ADDR'];
$inhoud_mail = "===================================================\n";
$inhoud_mail .= "Ingevulde contact formulier\n";
$inhoud_mail .= "===================================================\n\n";
$inhoud_mail .= $_SERVER['SCRIPT_URI'] . "\n\n";
$inhoud_mail .= "Naam: " . $_POST['naam'] . "\n";
$inhoud_mail .= "E-mail adres: " . $_POST['mail'] . "\n";
$inhoud_mail .= "Bericht:\n";
$inhoud_mail .= $_POST['msggs'] . "\n\n";
$inhoud_mail .= "Verstuurd op " . $datum . " via het ip " . $ip . "\n\n";
$inhoud_mail .= "===================================================\n\n";
$headers = "From: " . $_POST['naam'] . " " . $_POST['tussenvoegsel'] . " " . $_POST['achternaam'] . "<" . $_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
mail($mail_ontv, $_POST['onderwerp'], $inhoud_mail, $headers);
echo "<p class='font_content_info'><b>Je e-mail is verstuurd</b></p>";
echo "<p class='font_content_info'>Bedankt voor het versturen van een e-mail. Je zult snel een antwoord ";
echo "krijgen indien dit nodig is.</p>";
echo "<p class='font_content_info'>We nemen alles serieus en zullen vertrouwelijk omgaan met de informatie ";
echo "die we binnen krijgen. Je e-mail adres zal nooit aan derden worden verstrekt.</p>";
}
?>
Thanks!