Formular, creating
From FundaWiki
There is yet no module to handle e-mail formulars and simular. Here is a short example on how to create a simple formular. Beware that this is not secured against misusage.
In order to create a formular you need to be able to insert php-elements.
Create a new page in the fundanemt site editor. and insert a php-element with following code:
//formular data has been posted
if(isset($_POST) && count($_POST)) {
$mail = "This data has been posted from your site:\n\n";
foreach($_POST as $key=>$value) $mail .= $key . " = " . $value . "\n";
//mail the data - insert your own data here:
if(mail("user@domain.tld","E-mail subject",$mail)) {
print '
Your data was recieved!
';
} else {
print '
Failure - too bad!
';
}
}
//print the formular:
else {
print '
<p>
Please fill in your data:
</p>
<form action="' . $this->getUrl($this->ID,false,false) . '" method="post">
<label for="fname">Name:</label><input type="text" name="name" id="fname"><br>
<label for="fstreet">Street:</label><input type="text" name="street" id="fstreet"><br>
<label for="fzip">zip code:</label><input type="text" name="zip" id="fzip"><br>
<label for="fcity">city:</label><input type="text" name="city" id="fcity"><br>
<input type="submit" value="submit">
</form>
';
}
