Hallo,

Ik krijg na het invullen van het formulier alleen het mailadres van de zender en een onderwerp.
Hoe krijg ik de inhoud van de velden in mijn mail? (inclusief tekstveld)
BVD

<?php
error_reporting(E_ALL);
require_once(dirname('_FILE_').DIRECTORY_SEPARATOR.'database.php');
if(!isset($_POST['Submit']))
{
?>
<html>
<head>
<title>Naam</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="Naam">
<meta name="robots" content="all">
<meta name="language" content="NL">
<meta name="revisit-after" content="30 days">
<meta name="author" content="Naam">
<meta http-equiv=Page-Enter content=blendTrans(Duration=0.3)>
<meta http-equiv=Page-Exit content=blendTrans(Duration=0.3)>
<style type="text/css">
body {
background-color:#FFFFFF;
}
body, tr, td {
color:#999999;
font-family:"Century Gothic";
font-size:12px;
}
input, text, textarea, select {
color:#999999;
font-family:"Century Gothic";
font-size:12px;
}
a:link {
color:#999999;
font-family:"Century Gothic";
font-size:12px;
text-decoration:underline;
}
a:hover {
color:#00FF00;
font-family:"Century Gothic";
font-size:12px;
text-decoration:underline;
}
a:visited {
color:#999999;
font-family:"Century Gothic";
font-size:12px;
text-decoration:underline;
}
</style>
<script>
<!--
if (window.Event)
document.captureEvents(Event.MOUSEUP);
function nocontextmenu()
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
function norightclick(e)
{
if (window.Event)
{
if (e.which == 2 || e.which == 3)
return false;
}
else
if (event.button == 2 || event.button == 3)
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
}
document.oncontextmenu = nocontextmenu;
document.onmousedown = norightclick;
function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
//-->
</script>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center">
<table id="Table_01" width="1024" height="769" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="10">
<img src="images/index_01.gif" width="1024" height="34" ></td>
</tr>
<tr>
<td colspan="2">
<img src="images/index_02.gif" width="174" height="1" ></td>
<td width="164px" height="111" colspan="2" rowspan="2" align="center" valign="middle" bgcolor="#000000" style="background-image:url(images/index_03.gif); background-repeat:repeat-y;">
<form action="" method="post" name="login" id="login">
<input type="hidden" name="Submit" value="login">
<div style="margin-top:10px"><input name="gebruikersnaam" type="text" id="gebruikersnaam" value="gebruikersnaam"></div>

<div style="margin-top:10px"><input name="wachtwoord" type="text" id="wachtwoord" value="wachtwoord"></div>

<div style="margin-top:10px"><input name="image" type="image" onClick="this.form.submit();" value="Submit" src="images/login.gif" alt="Submit" /></div>
</form>
</td>
<td colspan="6" rowspan="2">
<img src="images/index_04.gif" width="687" height="111" ></td>
</tr>
<tr>
<td rowspan="5">
<img src="images/index_05.gif" width="164" height="733" ></td>
<td>
<img src="images/index_06.gif" width="10" height="110" ></td>
</tr>
<tr>
<td colspan="2" rowspan="2" width="11" height="402" style="background-image:url(images/index_07.gif); background-repeat:repeat;"></td>
<td width="162" height="402" rowspan="2" align="center" valign="top" style="background-image:url(images/index_08.gif); background-repeat:repeat;"><p><img src="images/menu.gif" width="163" height="197" border="0" usemap="#Map">
<map name="Map">
<area shape="rect" coords="1,85,162,112" href="persoonlijk.php">
<area shape="rect" coords="1,170,162,196" href="contact.php">
<area shape="rect" coords="1,141,162,169" href="tarieven.php">
<area shape="rect" coords="1,57,162,84" href="projecten.php">
<area shape="rect" coords="1,29,162,56" href="diensten.php">
<area shape="rect" coords="1,1,162,28" href="index.php">
<area shape="rect" coords="1,113,162,140" href="http://cp-nl.nl/forum/">
</map>
</p>
<p><a href="http://www.kika.nl/"; target="_blank"><img src="images/kika.png" border="0"></a></p></td>
<td>
<img src="images/index_09.gif" width="5" height="39" ></td>
<td colspan="5">
<img src="images/index_10.gif" width="682" height="39" ></td>
</tr>
<tr>
<td width="5" height="363" style="background-image:url(images/index_11.gif); background-repeat:repeat;"></td>
<td width="368" height="363" align="left" valign="top" style="background-image:url(images/index_12.gif); background-repeat:repeat;">
<?php
if(!isset($_GET['contact']))
{
?>
<!-- ZET HIERONDER JE EIGEN TEKST NEER -->
<hr> Contactformulier
<form name="form1" method="post" action="">
<input name="Submit" type="hidden" id="Submit" value="contact">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40%" align="left" valign="top">naam</td>
<td width="60%" align="left" valign="top"><input name="naam" type="text" id="naam" style="width:150px;"></td>
</tr>
<tr>
<td align="left" valign="top">achternaam</td>
<td align="left" valign="top"><input name="achternaam" type="text" id="achternaam" style="width:150px;"></td>
</tr>
<tr>
<td align="left" valign="top">&nbsp;</td>
<td align="left" valign="top">&nbsp;</td>
</tr>
<tr>
<td align="left" valign="top">email adres </td>
<td align="left" valign="top"><input name="email" type="text" id="email" style="width:150px;"></td>
</tr>
<tr>
<td align="left" valign="top">telefoon nummer </td>
<td align="left" valign="top"><input name="telefoon" type="text" id="telefoon" style="width:150px;"></td>
</tr>
<tr>
<td align="left" valign="top">&nbsp;</td>
<td align="left" valign="top">&nbsp;</td>
</tr>
<tr>
<td align="left" valign="top">onderwerp</td>
<td align="left" valign="top"><select name="onderwerp" id="onderwerp" style="width:150px;">
<option>Onderwerp</option>
<option value="inhoud">Inhoud website</option>
<option value="dienst">Diensten</option>
<option value="project">Projecten</option>
<option value="sales">Sales/Tarieven</option>
<option value="overige">Overige</option>
</select>
</td>
</tr>
<tr>
<td align="left" valign="top">bericht</td>
<td align="left" valign="top"><textarea name="bericht" rows="7" id="bericht" style="width:150px;"></textarea></td>
</tr>
<tr>
<td align="left" valign="top">&nbsp;</td>
<td align="left" valign="top">&nbsp;</td>
</tr>
<tr>
<td align="left" valign="top"><input name="Submit" type="submit" id="Submit" value="verstuur" style="width:70px; color:#92C14A;"></td>
<td align="left" valign="top">&nbsp;</td>
</tr>
</table>
</form>
<?php
}
if(isset($_GET['contact']) && $_GET['contact'] == "service")
{
?>
<form name="form1" method="post" action="">
<input name="Submit" type="hidden" id="Submit" value="contact">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="40%" align="left" valign="top">naam</td>
<td width="60%" align="left" valign="top"><input name="naam" type="text" id="naam"></td>
</tr>
<tr>
<td align="left" valign="top">achternaam</td>
<td align="left" valign="top"><input name="achternaam" type="text" id="achternaam"></td>
</tr>
<tr>
<td align="left" valign="top">&nbsp;</td>
<td align="left" valign="top">&nbsp;</td>
</tr>
<tr>
<td align="left" valign="top">email adres </td>
<td align="left" valign="top"><input name="email" type="text" id="email"></td>
</tr>
<tr>
<td align="left" valign="top">telefoon nummer </td>
<td align="left" valign="top"><input name="telefoon" type="text" id="telefoon"></td>
</tr>
<tr>
<td align="left" valign="top">&nbsp;</td>
<td align="left" valign="top">&nbsp;</td>
</tr>
<tr>
<td align="left" valign="top">onderwerp</td>
<td align="left" valign="top"><select name="onderwerp" id="onderwerp">
<option>Onderwerp</option>
<option value="inhoud">Inhoud website</option>
<option value="dienst">Diensten</option>
<option value="project">Projecten</option>
<option value="sales">Sales/Tarieven</option>
<option value="overige">Overige</option>
</select>
</td>
</tr>
<tr>
<td align="left" valign="top">bericht</td>
<td align="left" valign="top"><textarea name="bericht" rows="5" id="bericht"></textarea></td>
</tr>
<tr>
<td align="left" valign="top">&nbsp;</td>
<td align="left" valign="top">&nbsp;</td>
</tr>
<tr>
<td align="left" valign="top"><input name="Submit" type="submit" id="Submit" value="verstuur" style="width:70px; color:#92C14A;"></td>
<td align="left" valign="top">&nbsp;</td>
</tr>
</table>
</form>
<?php
}
?></td>
<td width="9" height="363" style="background-image:url(images/index_13.gif); background-repeat:repeat;"></td>
<td width="153" height="363" align="center" valign="top" style="background-image:url(images/index_14.gif); background-repeat:repeat;"><a href="http://cp-nl.nl/projecten.php"><img src="images/projecten.png" width="141" height="336" border="0"></a></td>
<td width="9" height="363" style="background-image:url(images/index_15.gif); background-repeat:repeat;"></td>
<td rowspan="3">
<img src="images/index_16.gif" width="143" height="584" ></td>
</tr>
<tr>
<td colspan="8" width="717" height="61" ><img src="images/index_17.gif" width="717" height="61" border="0" usemap="#Map3">
<map name="Map3">
<area shape="rect" coords="418,25,516,34" href="http://www.adobe.com/nl/products/acrobat/readstep2.html"; target="_blank">
<area shape="rect" coords="259,25,400,34" href="Algemene voorwaarden.pdf">
</map></td>
</tr>
<tr>
<td colspan="8">
<img src="images/index_18.gif" width="717" height="160" ></td>
</tr>
<tr>
<td>
<img src="images/spacer.gif" width="164" height="1" ></td>
<td>
<img src="images/spacer.gif" width="10" height="1" ></td>
<td>
<img src="images/spacer.gif" width="1" height="1" ></td>
<td>
<img src="images/spacer.gif" width="162" height="1" ></td>
<td>
<img src="images/spacer.gif" width="5" height="1" ></td>
<td>
<img src="images/spacer.gif" width="368" height="1" ></td>
<td>
<img src="images/spacer.gif" width="9" height="1" ></td>
<td>
<img src="images/spacer.gif" width="153" height="1" ></td>
<td>
<img src="images/spacer.gif" width="9" height="1" ></td>
<td>
<img src="images/spacer.gif" width="143" height="1" ></td>
</tr>
</table>
</div>

<map name="Map">
<area shape="rect" coords="1,170,162,196" href="contact.php">
<area shape="rect" coords="1,141,162,169" href="tarieven.php">
<area shape="rect" coords="1,57,162,84" href="projecten.php">
<area shape="rect" coords="1,29,162,56" href="diensten.php">
<area shape="rect" coords="1,1,162,28" href="index.php">
</map>
</body>
</html>

<?php
}
else
{
if($_POST['Submit'] == "login")
{
echo "<script language=\"javascript\"> alert('inlog script'); </script>";
echo "<script language=\"javascript\"> location.href=''; </script>";
}
if($_POST['Submit'] == "verstuur")
{
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "X-Mailer: PHP/" . phpversion() . "\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "Priority: Urgent\r\n";
$headers .= "Importance: Low\r\n";
$headers .= "X-MSMail-Priority: normal\r\n";
$headers .= 'From: '.$_POST['naam'].' <'.$_POST['email'].'>' . "\r\n";
$headers .= 'Reply-To: '.$_POST['naam'].' <'.$_POST['email'].'>' . "\r\n";
// bericht genereren aan CP
$datum = date("U");
$bericht = "Bericht ontvangen via contactformulier<br><br>
U heeft een bericht ontvangen op ".date("j-n-Y", $datum)."<p>.";
// email versturen
mail("[email protected]", "reactie via contactformulier", $bericht, $headers);
$aheaders = 'MIME-Version: 1.0' . "\r\n";
$aheaders .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$aheaders .= "X-Mailer: PHP/" . phpversion() . "\r\n";
$aheaders .= "X-Priority: 3\r\n";
$aheaders .= "Priority: Urgent\r\n";
$aheaders .= "Importance: Low\r\n";
$aheaders .= "X-MSMail-Priority: normal\r\n";
$aheaders .= 'From: Naam<[email protected]>' . "\r\n";
$aheaders .= 'Reply-To: Naam<[email protected]>' . "\r\n";
$abericht = "
Geachte heer/mevrouw,<p>

Bedankt voor uw reactie vanaf onze website.<p>

Wij zullen uw vraag/opmerking of aanvraag (ook dus afhankelijk vanaf welk form ze reageren) spoedig in behandeling nemen.<p>

Met vriendelijke groet,<p>

Geef hier uw naam op";
mail("".$_POST['email']."", "Bedankt voor uw reactie vanaf onze website", $agenerated, $aheaders);
echo "<script language=\"javascript\"> alert('dank u wel, wij nemen spoedig contact met u op!'); </script>";
echo "<script language=\"javascript\"> location.href='index.php'; </script>";
}
}
?>
Ja, eindelijk. hartelijk dank voor jullie reacties!!! Top.

Jouw script ziet er niet echt af uit.

Ik bedoel, je hebt dan het hele gigantische stuk, vervolgens verstuur je de mail (mail(...)), daarna zet je nog wat variabelen en dan stopt het?
Maarten schreef op 15.08.2008 13:34
Jouw script ziet er niet echt af uit.

Ik bedoel, je hebt dan het hele gigantische stuk, vervolgens verstuur je de mail (mail(...)), daarna zet je nog wat variabelen en dan stopt het?

Ik zie niks verkeerds.

Zie laatste regel "<script language=\"javascript\"> location.href='index.php'; </script>";
Hierdoor wordt de bezoeker doorverwezen naar de index.php.
De redirect zou ik ook anders doen en verdient dus geen schoonheidsprijs, maar voor browsers die javascript aan hebben staan werkt dit script naar mijn weten wel.
Hoe kan ik dat dan het beste doen die redirect?
Zie het topic dat je net (per ongeluk?) hebt aangemaakt.

Reageren