Page 1 of 1

formmail.php help

Posted: Tue Mar 02, 2004 1:55 pm
by Ibis
I am so ignorant when it comes to php, I really haven't a clue what to do.
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++)
    &#123;
        $name = $list&#1111;$ii];
        if ($name)
        &#123;
                //
                // field names can be just straight names, or in this
                // format:
                //      fieldname:Nice printable name for displaying
                //
            if (($nice_name_pos = strpos($name,":")) > 0)
            &#123;
                $nice_name = substr($name,$nice_name_pos + 1);
                $name = substr($name,0,$nice_name_pos);
            &#125;
            else
                $nice_name = $name;
            if (!isset($vars&#1111;$name]) || empty($vars&#1111;$name]))
            &#123;
                $bad = true;
                $missing .= "$nice_name\n";
            &#125;
        &#125;
    &#125;
    return (!$bad);
&#125;
Could someone please give me an example of the above with some pretend field names in the appropriate spots with correct format?
Later there is the following bit of code in the script:

Code: Select all

if (!CheckRequired($SPECIAL_VALUES&#1111;"required"],$aFormData,$missing))
	Error("missing_fields","The form required some values that you did not seem to provide.\n".$missing);
Is it the case that I just leave that as is?

Ibis

Posted: Tue Mar 02, 2004 2:00 pm
by infolock
question : what exactly is the purpose of this code?

Posted: Tue Mar 02, 2004 2:23 pm
by Ibis
This is part of a script designed for processing an html form. The complete original can be found at http://www.tectite.com.

Posted: Tue Mar 02, 2004 4:15 pm
by infolock
well, i went ahead and dowloaded the script, and it tells you step by step what you are suposed to do, and how to pass values into it for processing...

so, if you can't read the file and understand it, i'd suggest ya post that you need someone to write a script for you in the Help Wanted section. Because, and I don't mean for this to be rude, but you should have no problem using this script with some php experience prior...

if the script is too complex, another alternative is to search the web for one that is a little easier.. but you are not gonna find one that does everything you need it to without some tweaking of some sort ( well, at least not a script that does what it does.. )