Login Retreive lost passwordRegister
Search

Forum Index / General / Username check

[ This topic is solved ]

  Roger Beckers 08 April 09 / 08:34  
hello,

how can i check if username exists in the database ?


    $form =& new dbFormHandler('addUser');
    $form->setConnectionResource($connection,"users","mysql");
    $form->addHTML("<h5>Gebruiker toevoegen</h5>");
    $form->addHTML( "<tr>\n"."<td colspan='3'><hr size='1' /></td>\n"."</tr>\n");  
        $form->setMask("<tr><td>%title% %seperator%</td>\n"."  <td>%field% %error%</td></tr>\n",true); 
         
    $form->textField("Gebruikersnaam", "username", FH_NOT_EMPTY);
    
    $form->textField("Email", "email", FH_EMAIL_HOST);
    $form->selectField("Groep naam", "groupid", $groups, FH_NOT_EMPTY, true);
    $form->passField("Wachtwoord","password",FH_PASSWORD, 20,32);
    $form->passField("Wachtwoord (herhaal)", "myPass_re");
    $form->addValue("password", md5( $form->Value("password") ) );
    $form->checkPassword( "password", "myPass_re" );
    $form->hiddenField("active", "1");
    $form->onCorrect('saveSucces');
    $form->submitButton("Opslaan");

  Johan Wiegel (Admin) 08 April 09 / 09:20  
Simply add a index unique on the column in the database

  Roger Beckers 08 April 09 / 09:26  
thnx, it works :)

  Top


powered by PHP-GLOBE   © 2004 - 2012 FormHandler. All rights reserved.   -   Open source license