I have the latest version downloaded. Tried downloading the api file too but i guess its the same version. I've spent over 10+ hours on this and still stuck with it!
Every time i try to use any api, i get this error shown below. I have downloaded the demo forms and it works until i add some api function:
I also realized that there's no messages.tpl under this folder ../global/smarty/. Is this some bug? I need this fixed badly since i can't get the "api_check_submission_is_unique" function. Please have a look at the earliest. I've already missed my deadline
Here's the form i'm currently working on if you would like to have a look:
Every time i try to use any api, i get this error shown below. I have downloaded the demo forms and it works until i add some api function:
Code:
The "[b]../../global/smarty/messages.tpl[/b]" template could not be located at the following locations: [b]/Applications/XAMPP/xamppfiles/htdocs/formtools/themes/default/../../global/smarty/messages.tpl[/b] and [b]/Applications/XAMPP/xamppfiles/htdocs/formtools/themes/default/../../global/smarty/messages.tpl.[/b]
I also realized that there's no messages.tpl under this folder ../global/smarty/. Is this some bug? I need this fixed badly since i can't get the "api_check_submission_is_unique" function. Please have a look at the earliest. I've already missed my deadline
Here's the form i'm currently working on if you would like to have a look:
Code:
<?php
require_once("../global/api/api.php");
$fields = ft_api_init_form_page(3);
$errors = array();
if (isset($_POST["submit_button"]))
{
$rules = array();
$rules[] = "required,fullname,Please enter your name.";
$rules[] = "required,email,Please enter your email address.";
$rules[] = "valid_email,email,Please enter a valid email address.";
$rules[] = "required,comments,Please enter your comments.";
$errors = validate_fields($_POST, $rules);
$criteria = array("email" => $_POST["email"]);
if (!ft_api_check_submission_is_unique(3, $criteria, $fields["form_tools_submission_id"]))
{
$errors[] = "Sorry, that email is already taken. Please enter another one.";
}
// 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_button",
"next_page" => "thanx.php",
"form_data" => $_POST,
"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);
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Sample Form</title>
</head>
<body>
<?php
if (!empty($errors))
{
echo "<div class='error'>Please fix the following errors:\n<ul>";
foreach ($errors as $error)
echo "<li>$error</li>\n";
echo "</ul></div>";
}
?>
<form method="post" action="<?=$_SERVER["PHP_SELF"]?>">
<table cellspacing="0" cellpadding="0">
<tr>
<td width="120">Name</td>
<td><input type="text" name="fullname" value="<?=htmlspecialchars(@$fields["fullname"])?>" /></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="email" value="<?=htmlspecialchars(@$fields["email"])?>" /></td>
</tr>
<tr>
<td>Comments</td>
<td><textarea name="comments"><?=@$fields["comments"]?></textarea></td>
</tr>
</table>
<p>
<input type="submit" name="submit_button" value="Submit Form" />
</p>
</form>
</body>
</html>