My code here is completely working, but I feel like I destroyed or didn't follow the DRY rule, what suggestions can you give to me for this code??
<?php require_once("./includes/Utilities.php") ;?>
<?php require_once("./includes/Db_Resources/db_connection.php");?>
<?php require_once("./includes/Db/DatabaseUtilities.php"); ?>
<?php
if(isset($_POST['submit'])){
require_once("./includes/process_form.inc.php");
require_once('./includes/Db/CheckPassword.php');
require_once('./includes/Db/CheckUsername.php');
$check_pwd = new Db_CheckPassword($password);
$check_user = new Db_CheckUsername($username,$conn);
$passwordOK = $check_pwd->check();//Checks if Password is valid
$userOK = $check_user->check();//Checks if Username is valid
//Checks if Password is the same with the retyped password
$password_match = Db_CheckPassword::confirmPassword($password,$conf_pass);
//if everything is okay! we'll finally add the muthafucking users account
if($userOK && $passwordOK && $password_match){
if(Db_DatabaseUtilities::registerAccount($conn,$username,$password,$email)){
header("Location: login.php");
exit;
}
}else{
$pass_error = $check_pwd -> getErrors();
$user_error = $check_user->getErrors();
}
}
?>