So I've decided that while stuck in quarantine I am going to practice some coding in preparation for my web development class in September. So I have been trying to create a simple registration page. It seems as though everything else works just fine but when I test to see if the errors work they don't actually show up. I can't seem to find anything wrong with it. I have a seperate php file for errors and then my registration file and a server file.
This is the code for my registration form
<!doctype html>
<html>
<body>
<div class=container>
<h1>Register</h1>
<p>Please fill in the form to create an account</p>
<form method="post" action="register.php">
<?php include ('errors.php'); ?>
<label>Email: </label>
<input type="text" name="email" value="<?php echo $username; ?>"><br>
<label>Username: </label>
<input type="text" name="username" value="<?php echo $email; ?>"><br>
<label>Password: </label>
<input type="Password" name="password"><br>
<label>Confirm Password: </label>
<input type="password" name="password2"><br>
<button class="registerbtn" type="submit" name="registerbtn">Register</button>
</form>
<p align="center">Already have an account? <a href="login.php">Sign in</a>.</p>
</div>
<?php
include 'footer.php'
?>
</body>
</html>
This is the code for my errors
<?php
$errors = array();
?>
<?php if (count($errors) > 0) : ?>
<div class="error">
<?php foreach ($errors as $error) : ?>
<p><?php echo $error ?></p>
<?php endforeach ?>
</div>
<?php endif ?>