Hi,
Before I edited my form php files (using API) the no_sessions_url was working fine. Since I added form PHP validation this setting is ignored.
What am I doing wrong?
Before I edited my form php files (using API) the no_sessions_url was working fine. Since I added form PHP validation this setting is ignored.
What am I doing wrong?
Code:
<?php
ini_set('display_errors', 1);
error_reporting( E_ALL);
require_once("/home/tandform/public_html/formtools/global/api/api.php");
$fields = ft_api_init_form_page("", "live", "tandform");
// validation time!
$errors = array();
if (isset($_POST['submit']))
{
$rules = array();
$rules[] = "required,plaatstekort_7,PLAATSTEKORT (7): gelieve een selectie te maken.";
$rules[] = "required,malocclusieh_8,HORIZONTALE MALOCCLUSIE (8): gelieve een selectie te maken";
$rules[] = "required,malocclusiev_9,VERTICALE MALOCCLUSIE (9): gelieve een selectie te maken.";
$errors = validate_fields($_POST, $rules);
// no errors - 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(
"no_sessions_url" => "index.php",
"namespace" => "tandform",
"submit_button" => "submit",
"next_page" => "index3.php",
"form_data" => $_POST
);
ft_api_process_form($params);
}
// failed validation. Update $fields with the latest contents of the form data
else
{
$fields = array_merge($_SESSION["tandform"], $_POST);
}
}
?>