Hello there,
I've found a really nice form class here: http://code.google.com/p/php-form-builder-class/ , I don't know whether any of you are familiar with it.
I need a solution to mail the contents of the array and echo out a "Congratulations" message.
Can anybody help?
My current form looks like this:
<?php
error_reporting(E_ALL);
session_start();
include("../class.form.php");
if(isset($_POST["cmd"]) && $_POST["cmd"] == "submit")
{
echo "<pre>" . htmlentities(print_r($_POST,true)) . "</pre>";
exit();
}
elseif(!isset($_GET["cmd"]) && !isset($_POST["cmd"]))
{
?>
<?php
$form = new form("form_elements");
$form->setAttributes(array(
"includesPath" => "../includes",
"width" => "400"
));
$form->addHidden("cmd", "submit");
$form->addTextbox("Name:", "field0", "", array("required" => 1));
$form->addTextbox("Number:", "field1", "", array("required" => 1));
$form->addDateTime("Date/Time:", "field7","", array("required" => 1));
$form->addEmail("Email:", "field22", "", array("required" => 1));
$form->addButton();
$form->render();
echo '<pre>' . htmlentities('<?php
$form = new form("form_elements");
$form->setAttributes(array(
"includesPath" => "../includes",
"width" => "400"
));
$form->addHidden("cmd", "submit");
$form->addTextbox("Textbox:", "field0");
$form->addDateTime("Date/Time:", "field7");
$form->addEmail("Email:", "field22");
$form->addButton();
$form->render();
?>') . '</pre>';
?>
</body>
</html>
<?php
}
?>