I use PHP to check the password and re-password if it is correct I will enter the data if it is wrong I will print a message in the span tag. How to print errors in span tag in HTML? Thank for help
<?php
if(isset($_POST["username"]) && isset($_POST["password"]) && isset($_POST["name"]) && isset($_POST["e-mail"])) {
$accPhone = $_POST["username"];
$accPasswd = $_POST["password"];
$accPasswd=md5($_POST['password']);
$accName = $_POST["name"];
$accMail = $_POST["e-mail"];
if('password' === 're-password') {
$query = "INSERT INTO accounts(accPhone,accPasswd,accName,accMail,accType) VALUES ('$accPhone','$accPasswd','$accName','$accMail','1')";
$result = $conn->query($query) or die("Query failed: " . $conn->error);
} else {
// print error to span tag in html
}
}