contact.php
<?php
session_start();
include('libs/Smarty.class.php');
// create object
$smarty = new Smarty;
// assign some content. This would typically come from
// a database or other source, but we'll use static
// values for the purpose of this example.
//$smarty->assign('title', 'Contact');
// display it
$smarty->display('extends:layout.tpl|header.tpl|contact.tpl|footer.tpl');
// contact
if (isset($_POST['Submit]'])) {
$to = "[email protected]";
$subject = "Nieuw bericht";
$message = $_POST['bericht'];
if (mail($to, $subject, $message)) {
echo "<p>Bericht verzonden!</p>";
} else {
echo "<p><strong>Mislukt!</strong> Probeer het opnieuw!</p>";
}
}
?>contact.tpl
{extends file="layout.tpl"}
{block name=title}Contact{/block}
{block name=content}
<form id="contact" name="contact" method="post" action="contact.php">
<table width="450" border="0" cellpadding="3" cellspacing="0">
<tr>
<td width="83" align="right" valign="top">Van:</td>
<td width="355"><input name="van" type="text" id="van" /></td>
</tr>
<tr>
<td align="right" valign="top">Body:</td>
<td><textarea name="bericht" id="bericht"></textarea></td>
</tr>
<tr>
<td><input name="Submit" type="submit" value="Zenden" /></td>
</tr>
</table>
</form>
{/block}Werkt niet. Hoe moet het eigenlijk ?
[size=xsmall]Toevoeging op 18/05/2011 16:38:03:[/size]
Misschien ook opmerkingen over mijn tree ?