-2

i am getting following error while running the code
any help

if(!$subcurpass){
        $form->setError($field, "* Current Password not entered");
     }
     else{
        $subcurpass = stripslashes($subcurpass);
        if(strlen($subcurpass) < 4   
        !eregi("^([0-9a-z])+$", ($subcurpass = trim($subcurpass)))){
           $form->setError($field, "* Current Password incorrect");
waleed khan
  • 15
  • 1
  • 1
  • 9

1 Answers1

0

In your if condition below, you are checking the length of a string and then also doing a regular expression match on the string. Those are two separate logic operations and you need to join them together with either an OR (||) or an AND (&&) depending on what you're trying to achieve:

if(strlen($subcurpass) < 4   
    !eregi("^([0-9a-z])+$", ($subcurpass = trim($subcurpass))))

You're missing a logic operator after

if(strlen($subcurpass) < 4
Andy
  • 708
  • 15
  • 21