Hello,
I searched the forum for this but could not find any code other than (dB unique index) solution..
When stavroz said he could not find it too, i gave up the search an prepared my own code.. here is how i did it :
in the file Class.FormHandler.inc.php there is an (if) statement that looks like this (around line 1421):
Code:
if (!$this-> FG_fit_expression[$i]){
$this->VALID_SQL_REG_EXP = false;
$form_action="ask-add";
}
Add an (else) branch and make it look similar to this :
Code:
if (!$this-> FG_fit_expression[$i]){
$this->VALID_SQL_REG_EXP = false;
$form_action="ask-add";
} else { // dB based verification
switch ($fields_name) {
case 'email' :
$QUERY = "select count(email) from cc_card where email = '".$_POST["email"]."' " ;
$res = $this -> DBHandle -> Execute($QUERY) ;
$row = $res -> fetchRow() ;
if ($row[0] > 0) {
$this -> FG_fit_expression[$i]= false ;
// Mean and dirty by all means, but hey .. all is fair in love and war and A2B hacking !
$this -> FG_regular[1][1] = " (This email is already registered! Have you forgot your account password ? You can retrive it below)" ;
$this->VALID_SQL_REG_EXP = false;
$form_action="ask-add";
}
break ;
// case something else
// case something else 2
} // switch
}// else
The (switch) is not necessary but it is useful if you want to do dB verification on some other fields later