Hi,
Can someone lead me in the right direction on how to write a preg_match.
I have username and password in the DB.
And the username should be case sensitive, accordingly to whatever is in the db.
And it should only be able to contain numbers and letters.
I have this, but I havent used preg_match before, sp I am a little confused on how the syntax works and where to put what i want.
if(preg_match('/^[A-Z\'.-]{2-20}$/i',$_POST['username'])){
$username = trim($_POST['username']);
$username = mysqli_real_escape_string($connection, $username);
}
Hope somene can explain me the way this chinese is to be translated :-)