//register users
$username= mysqli_real_escape_string($db, $_POST[\'username\']);
$email= mysqli_real_escape_string($db, $_POST[\'email\']);
$password1= mysqli_real_escape_string($db, $_POST[\'password1\']);
$password2= mysqli_real_escape_string($db, $_POST[\'password2\']);
//form validation
if(empty($username)){array_push($errors, "Username is required")};
if(empty($email)) {array_push($errors, "Email is required")};
if(empty($password)) {array_push($errors, "Password is required")};