Form Tools
no_session_url ignored since php validation is implemented - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Modules / Other (https://forums.formtools.org/forumdisplay.php?fid=8)
+--- Forum: Form Validation: JS + PHP (https://forums.formtools.org/forumdisplay.php?fid=18)
+--- Thread: no_session_url ignored since php validation is implemented (/showthread.php?tid=2245)



no_session_url ignored since php validation is implemented - chuanse - Oct 25th, 2012

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?

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);
  }
}
?>



RE: no_session_url ignored since php validation is implemented - chuanse - Oct 29th, 2012

Is there really nobody who can answer this question?

Why is no_sessions_url ignored when using php form validation while it works perfectly without the formvalidation lines? :/


RE: no_session_url ignored since php validation is implemented - sher77 - Jan 5th, 2015

I added form PHP validation this setting is ignored.