I'm hoping someone here can help me out. I'm trying to use formmail.php by tectite for my form. this is what part of the original script looks like:
Code: Select all
//
// Check the input for required values. The list of required fields
// is a comma-separated list of field names.
//
function CheckRequired($reqd,$vars,&$missing)
{
$bad = false;
$list = explode("",$reqd);
for ($ii = 0 ; $ii < count($list) ; $ii++)
{
$name = $listї$ii];
if ($name)
{
//
// field names can be just straight names, or in this
// format:
// fieldname:Nice printable name for displaying
//
if (($nice_name_pos = strpos($name,":")) > 0)
{
$nice_name = substr($name,$nice_name_pos + 1);
$name = substr($name,0,$nice_name_pos);
}
else
$nice_name = $name;
if (!isset($varsї$name]) || empty($varsї$name]))
{
$bad = true;
$missing .= "$nice_name\n";
}
}
}
return (!$bad);
}Later there is the following bit of code in the script:
Code: Select all
if (!CheckRequired($SPECIAL_VALUESї"required"],$aFormData,$missing))
Error("missing_fields","The form required some values that you did not seem to provide.\n".$missing);Ibis