Jump to content

wasimkham

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

wasimkham's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. well im gonna try perl regular expressions, i've just started learning them. but the thing wrong with your method is that ereg() function doesnt return a string, it returns a Boolean. thanks for you help, be back later if any problems
  2. [b]$pass_reg = ereg("^[0-9a-zA-Z]{5,12}",'1124adadsadasdasdsad',$match); print_r($match); if ($pass_reg) { echo "<p>Password is <b>correct</b><p>"; } else { echo "<p>Password is <b>incorrect</b><p>"; }[/b] Hi, im using this regular expression "^[0-9a-zA-Z]{5,12}" as password validation, but even if the string passed through ereg() is more than 12 characters, the ereg() function still returns True, and $match returns the first 12 characters of the string. This is the output of the script: Array ( [0] => 1124adadsada ) Password is [b]correct[/b] Can i configure it so that i can make it return False if the string passed is 12 characters or less? Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.