Hallo allemaal,
Ik maak een invulformulier waarvan de gegevens na een druk op de knop naar mn email verstuurd moeten worden...
Kan iemand mij vertellen wat er mis is aan deze code? Na een druk op de knop worden de gegevens niet verstuurd. Zonder php code start hij wel automatisch mijn email op.. Dit wil ik juist voorkomen met die formulier..
<?
if ($_POST[submit]) {
$tomail = "s.kamminga@gmail.com";
$frommail = $_POST[emailadres];
$fromname = $_POST[voornaam]." ".$_POST[achternaam];
$message = '
voornaam: '.$_POST[voornaam].'<br>
achternaam: '.$_POST[achternaam].'<br>
telefoonnummer: '.$_POST[telefoonnummer].'<br>
emailadres: '.$_POST[emailadres].'<br>
vragen: '.nl2br($_POST[vragen]).'<br>
';
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$fromname."<".$frommail.">\r\n";
$headers .= "Return-Path: <".$frommail.">\r\n";
mail($tomail, 'Interesse', $message, $headers);
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Homegrown Tuintafel</title>
<style type="text/css">
<!--
.style17 {font-family: Arial, Helvetica, sans-serif}
-->
</style>
</head>
<style type="text/css">
<!--
body {
background-image: url(contact.jpg);
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-repeat: no-repeat;
}
#formpje {
position: absolute;
top: 300px;
width: 390px;
height: 209px;
margin-left: 10px;
}
-->
</style>
<body text="#FFFFFF">
<div align="left">
<div id="formpje">
<table width="390" td height="209" align="left" cellpadding="0" cellspacing="0" text="#FFFFFF">
<tr>
<td width="128" height="28" align="left" valign="top" class="style14">
<div align="right"><font face="Arial, Helvetica, sans-serif, monospace"><strong><font color="#FFFFFF" size="2"><span class="style15"><span class="style17 style16">Voornaam</span> </font><font size="2"> </font></strong></font></div></td>
<td width="262" height="28" align="left" valign="top"> <input name="voornaam" type="text" class="style1" size="40" width="262">
</td>
</tr>
<tr>
<td width="128" height="28" align="left" valign="top" class="style14"><div align="right"><font face="Arial, Helvetica, sans-serif, monospace"><strong><font size="2"><span class="style15"><span class="style16 style17"><font color="#FFFFFF">Achternaam</font> </span></span></font></strong></font></div></td>
<td height="28" align="left" valign="top"> <input name="achternaam" type="text" class="style1" id="achternaam" size="40" width="262">
</td>
</tr>
<tr>
<td width="128" height="28" align="left" valign="top" class="style14"><div align="right" class="style17"><font face="Arial, Helvetica, sans-serif, monospace"><strong><font color="#FFFFFF" size="2"><span class="style16">Telefoonnummer </span></font></strong></font></div></td>
<td height="28" align="left" valign="top"> <input name="telefoonnummer" type="text" class="style1" id="telefoonnummer" size="40" width="262">
</td>
</tr>
<tr>
<td width="128" align="left" valign="top" class="style14"><div align="right" class="style17"><font face="Arial, Helvetica, sans-serif, monospace"><strong><font color="#FFFFFF" size="2"><span class="style16">E-mailadres </span></font></strong></font></div></td>
<td height="28" align="left" valign="top"> <input name="emailadres" type="text" class="style1" id="emailadres" size="40" width="262">
</td>
</tr>
<tr>
<td width="128" height="44" align="left" valign="top" class="style14"> </td>
<td height="44" align="left" valign="top">
<textarea name="vragen" cols="37" rows="3" id="vragen" height="44" widht="255" align="left" valign="top">Heeft u verder nog vragen?
Typt u die dan hier in.</textarea>
</td>
</tr>
<tr>
<td width="128" height="19" align="left" valign="top" td> </td>
<td align="left" valign="top">
<input type=submit value="Versturen">
<input type=reset value="Opnieuw">
</td>
</table>
</div>
</body>
</html>
Alvast hartstikke veel dank!
Ik maak een invulformulier waarvan de gegevens na een druk op de knop naar mn email verstuurd moeten worden...
Kan iemand mij vertellen wat er mis is aan deze code? Na een druk op de knop worden de gegevens niet verstuurd. Zonder php code start hij wel automatisch mijn email op.. Dit wil ik juist voorkomen met die formulier..
<?
if ($_POST[submit]) {
$tomail = "s.kamminga@gmail.com";
$frommail = $_POST[emailadres];
$fromname = $_POST[voornaam]." ".$_POST[achternaam];
$message = '
voornaam: '.$_POST[voornaam].'<br>
achternaam: '.$_POST[achternaam].'<br>
telefoonnummer: '.$_POST[telefoonnummer].'<br>
emailadres: '.$_POST[emailadres].'<br>
vragen: '.nl2br($_POST[vragen]).'<br>
';
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$fromname."<".$frommail.">\r\n";
$headers .= "Return-Path: <".$frommail.">\r\n";
mail($tomail, 'Interesse', $message, $headers);
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Homegrown Tuintafel</title>
<style type="text/css">
<!--
.style17 {font-family: Arial, Helvetica, sans-serif}
-->
</style>
</head>
<style type="text/css">
<!--
body {
background-image: url(contact.jpg);
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-repeat: no-repeat;
}
#formpje {
position: absolute;
top: 300px;
width: 390px;
height: 209px;
margin-left: 10px;
}
-->
</style>
<body text="#FFFFFF">
<div align="left">
<div id="formpje">
<table width="390" td height="209" align="left" cellpadding="0" cellspacing="0" text="#FFFFFF">
<tr>
<td width="128" height="28" align="left" valign="top" class="style14">
<div align="right"><font face="Arial, Helvetica, sans-serif, monospace"><strong><font color="#FFFFFF" size="2"><span class="style15"><span class="style17 style16">Voornaam</span> </font><font size="2"> </font></strong></font></div></td>
<td width="262" height="28" align="left" valign="top"> <input name="voornaam" type="text" class="style1" size="40" width="262">
</td>
</tr>
<tr>
<td width="128" height="28" align="left" valign="top" class="style14"><div align="right"><font face="Arial, Helvetica, sans-serif, monospace"><strong><font size="2"><span class="style15"><span class="style16 style17"><font color="#FFFFFF">Achternaam</font> </span></span></font></strong></font></div></td>
<td height="28" align="left" valign="top"> <input name="achternaam" type="text" class="style1" id="achternaam" size="40" width="262">
</td>
</tr>
<tr>
<td width="128" height="28" align="left" valign="top" class="style14"><div align="right" class="style17"><font face="Arial, Helvetica, sans-serif, monospace"><strong><font color="#FFFFFF" size="2"><span class="style16">Telefoonnummer </span></font></strong></font></div></td>
<td height="28" align="left" valign="top"> <input name="telefoonnummer" type="text" class="style1" id="telefoonnummer" size="40" width="262">
</td>
</tr>
<tr>
<td width="128" align="left" valign="top" class="style14"><div align="right" class="style17"><font face="Arial, Helvetica, sans-serif, monospace"><strong><font color="#FFFFFF" size="2"><span class="style16">E-mailadres </span></font></strong></font></div></td>
<td height="28" align="left" valign="top"> <input name="emailadres" type="text" class="style1" id="emailadres" size="40" width="262">
</td>
</tr>
<tr>
<td width="128" height="44" align="left" valign="top" class="style14"> </td>
<td height="44" align="left" valign="top">
<textarea name="vragen" cols="37" rows="3" id="vragen" height="44" widht="255" align="left" valign="top">Heeft u verder nog vragen?
Typt u die dan hier in.</textarea>
</td>
</tr>
<tr>
<td width="128" height="19" align="left" valign="top" td> </td>
<td align="left" valign="top">
<input type=submit value="Versturen">
<input type=reset value="Opnieuw">
</td>
</table>
</div>
</body>
</html>
Alvast hartstikke veel dank!