+ Reply to Thread
Results 1 to 5 of 5

Thread: database lookup based on form input.

  1. #1
    Join Date
    Mar 2008
    Posts
    3

    Default database lookup based on form input.

    Form is used to collect name, email, requested ID, and password from folks wanting to register to my site. Existing members are in a MySQL database.

    I'd like to verify that the ID they are requesting is available by doing a DB query within ttfm.php during the normal form processing of required fields. If it IS available, processing continues, and I receive the email with their info. If it is NOT available, I'd like to add an error message to the set of standard ttfm error messages and set the proper error code so that ttfm processes this error just like a "missing field" error.

    I can handle the php and MySQL coding. I just need to know which function should have this db check added; which array contains the error messages; what values in ttfm should be set to evoke the message in the event of look-up failure; any other variables that need to modified to indicate an additional error message exists; etc.

    Unless there is whole 'nother way of doing this that you recommend?

    Anyone?

  2. #2
    Join Date
    Mar 2008
    Posts
    3

    Default Re: database lookup based on form input.

    I think I found the correct location: fmhookchecks. Right?

    But there is no documentation on what variables I should set to indicate that my "check" has found an error.

    In fact, I found several hook-points by doing a FIND within ttfm.php - many more than are mentioned on the tectite website or in these forums. But none of these hook-points is documented anywhere. How long of a subscription do I have to purchase in order to get the documentation. What is included in the documentation? I'd like to know what I'm purchasing before I put up the money.

  3. #3
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: database lookup based on form input.

    Hi,

    The Hook System is yet to be documented.

    The Hook System is ideal for what you're trying to do.

    It's in use in a number of installations and works well.

    There's probably enough information on the forums from previously-asked questions, but if you need specific help I'm happy to assist you directly if you subscribe.

    The documentation for the Hook System will be written in the coming months, but being a free product, work on FormMail is prioritized over time.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  4. #4
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: database lookup based on form input.

    Hi again,

    This thread should tell you all you ineed:
    http://www.tectite.com/vbforums/showthread.php?t=1775
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  5. #5
    Join Date
    Mar 2008
    Posts
    3

    Default Re: database lookup based on form input.

    Quote Originally Posted by russellr View Post
    Hi again,

    This thread should tell you all you ineed:
    http://www.tectite.com/vbforums/showthread.php?t=1775
    Unfortunately, that thread just scratches the surface of what I need to know.

    Part of the problem is that if I wait until fmhookprefinish.inc to perform my validation, the email with all the data (including the bad data) has already been sent.

    I've studied ttfm.php, and I want to expand this portion where you perform special condition checks:
    Code:
    //
    // check complex conditions
    //
    if (!CheckConditions($SPECIAL_VALUES["conditions"],$aAllRawValues,$missing,$a_missing_list))
    UserError("failed_conditions",GetMessage(MSG_COND_ERROR),$missing,$a_missing_list);
    //
    // check imgverify
    //
    if (isset($SPECIAL_VALUES["imgverify"]) && !empty($SPECIAL_VALUES["imgverify"]))
    {
    //
    // VerifyImgString is from Tectite's simple verifyimg.php CAPTCHA
    // turing_string is from Captcha Creator
    //
    .
    .
    .
    //
    // Hook system: after performing required and conditions etc.
    //
    if ($HOOK_DIR !== "")
    @include("$HOOK_DIR/fmhookchecks.inc");
    If my customer has requested an ID that is NOT available, and I determine that in fmhookchecks.inc (by doing a MySQL look-up), do I also in fmhookchecks.inc execute these two lines?
    Code:
    $b_bad = true;
    UserError("failed_conditions","Requested ID is already in use","","");
    or can I just execute this:
    Code:
    Error("failed_conditions","Requested ID is already in use");

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Replies: 2
    Last Post: 28-May-2006, 06:50 AM
  2. "no input file specified"
    By GreenExplorer in forum Community Support
    Replies: 1
    Last Post: 21-Mar-2006, 07:27 PM
  3. How to send email based on drop-down selection?
    By pworks in forum FormMail Subscription Support
    Replies: 13
    Last Post: 27-Jan-2006, 01:29 AM
  4. Variables in HTML form - assigning input type
    By tvulucy in forum FormMail Subscription Support
    Replies: 4
    Last Post: 28-Oct-2004, 09:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts