Configuring the Other Form Pages

This step is very much like the previous. Add the following to the top of your pages. Note that the ft_api_init_form_page() line doesn't contain any parameters - that's important!

<?php
require_once("path/to/form_tools/global/api/api.php");
$fields = ft_api_init_form_page();
$params = array(
  "submit_button" => "submit_button_name_attribute",
  "next_page" => "next_page.php",
  "form_data" => $_POST,
  "no_sessions_url" => "first_page_in_form.php"
);
ft_api_process_form($params);
?>

Like before, you'll need to tweak the following for each form page:

  1. The path to the api.php file has to be updated for your server.
  2. Change "submit_button_name_attribute" to the name attribute of your form submit button.
  3. Change "next_page.php" to the next page in the form sequence. This should be different for each form page.
  4. Again, as before, if your form contains file fields, add one more parameter to the $params array: the last file_data row.
    $params = array(
      "submit_button" => "submit_button_name_attribute",
      "next_page" => "next_page.php",
      "form_data" => $_POST,
      "file_data" => $_FILES
    );
  5. Since generally you don't want people linking directly to the 2nd or 3rd page of your form - you want them to start on page 1 - the "no_sessions_url" parameter to this function lets you protect against this. It checks to see if sessions exist (i.e. were created on the first page of the form). If they weren't it boots the user out to the file specified. This can be an absolute or relative URL.

One Last Thing

On the final page of your form - the page BEFORE your "thank you" page - you'll want to make one last change. When the user clicks SUBMIT on that page, that's the point at which you'll want the form submission to be marked as complete, or "finalized". Add one additional parameter to the $params array:

"finalize" => true

So, your code will look something like this:

<?php
require_once("path/to/form_tools/global/api/api.php");
$fields = ft_api_init_form_page();
$params = array(
  "submit_button" => "submit_button_name_attribute",
  "next_page" => "next_page.php",
  "form_data" => $_POST,
  "finalize" => true
);
ft_api_process_form($params);
?>
Edit Page