This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

password protection multiple


  1. sipherlucian
    Member

    hi im creating a registration form for a website, is it possible to add more than one password for the form, i wish to have a different password for everyone that comes to the website, its a school registration form, sometimes people take their kids out of the school and i would need to block that person then, so every password has to be unique, doesnt matter about a login i dont need that, its just handier than emailing all of the users to tell them the password has changed, i know i could just duplicate a form everytime a new users to register a child, but thats just a pain, can anyone help me???

    Posted 15 years ago #
  2. sipherlucian
    Member

    hey can anybody help me out with this please?

    Posted 15 years ago #
  3. yuniar

    Yes, there is an easy workaround to do this.

    First, when you set the password for your form, use commas to separate multiple passwords.
    Example: pass1,pass2,pass3,pass4

    Then, edit your "includes/post-functions.php" file, search around line 30:

    $query = "select count(form_id) valid_password from ap_forms
    where form_id='{$form_id}' and form_password='{$input['password']}'";

    replace it with this code:

    $query = "select count(form_id) valid_password from ap_forms
    where form_id='{$form_id}' and form_password like '%{$input['password']}%'";

    that would allow you to set multiple passwords for one form.


    MachForm Founder

    Posted 15 years ago #
  4. sipherlucian
    Member

    thats great yuniar thank you very much! saves a lot of trouble

    Posted 15 years ago #
  5. sipherlucian
    Member

    another awkward one for ya, nice if this could be done, is it possible that when a form is filled out and the user has typed in a username and a password they would like to use, can it automatically be added to the post-functions.php file???

    Posted 15 years ago #

RSS feed for this topic

Reply