Hi Ben and thanks in advance to take a look at my code.
PHP Code:
<?php require_once("/home/a5060614/public_html/formtools_2.1.0._Beta/global/api/api.php");
$fields = ft_api_init_form_page(6);
// validation time!
$errors = array();
if (isset($_POST['Submit']))
{
$rules = array();
$rules[] = "required,nom,Veuillez entrer votre nom";
$rules[] = "required,email,Veuillez entrer votre adresse email";
$rules[] = "valid_email,email,Veuillez entrer une adresse email valide";
$rules[] = "required,code_postal,Veuillez indiquer votre code postal";
$rules[] = "digits_only,code_postal,Votre code postal ne doit comporter que des chiffres";
$rules[] = "required,pays,Veuillez indiquer votre pays";
$rules[] = "required,type,Veuillez indiquer le type de travaux que vous désirez";
$rules[] = "required,delai,Veuillez indiquer le délai que vous désirez";
$errors = validate_fields($_POST, $rules);
// no errors - great! Now we process the page. The ft_api_process_form does
// the job of both updating the database and redirecting to the next page
if (empty($errors))
{
$params = array(
"submit_button" => "Submit",
"next_page" => "Merci.php",
"form_data" => $_POST,
"file_data" => $_FILES,
"finalize" => true
);
ft_api_process_form($params);
}
// it failed validation. Update $fields with the latest contents of the form data
else
{
$fields = array_merge($_SESSION["form_tools_form"], $_POST);
}
}
?>